The Spain international suffered the injury in training last week to further impede his chances of returning to first-team action following surgery on a groin injury conducted in June.
A statement published on Madrid's official website read: "Xabi Alonso has had surgery on a fracture to the fifth metatarsal bone of his right foot. The operation was conducted with as few invasive techniques as possible."
No prognosis was offered by the capital club but the former Liverpool player, 31, is expected to be unavailable for at least a month.
He will miss Spain's World Cup qualifying match away to Finland on September 6, while there is serious doubt whether he will return in time for the final two Group I games, against Belarus and Georgia, in October.