The 32-year-old midfielder's deal expired at the end of the current season, but Madrid announced on Wednesday that he has penned a two-year extension.
A statement on the club's website read: "Xabi Alonso will continue with Real Madrid until 2016."
The Spain international has made 204 appearances for the club since signing from Liverpool for £30,000,000 in the summer of 2009 and has helped them win the 2012 Primera Division and the 2011 Copa del Rey.
A two-time European Championship winner and also a World Cup winner during his 109 caps for Spain, Alonso started his career with Real Sociedad before heading to Anfield.
News of Alonso's renewal comes on the day manager Carlo Ancelotti ruled out any movements in or out of the Bernabeu.
Alonso, Fabio Coentrao, Angel Di Maria and Alvaro Morata had all been linked with moves, with Manchester United said to be in for Coentrao and Arsenal for Morata.
However, Ancelotti said on Wednesday that the Spanish giants were not looking to bring in any new faces during the transfer window, nor let any players go.
He said when asked about the futures of Coentrao and Di Maria: ''I've not spoken with them because there's nothing. No-one is leaving and no-one is coming in.
''We have a good squad. We don't need anything.''