President Florentino Perez revealed the decision at a packed news conference.
Mourinho, 50, who has been linked with a return to Chelsea, won the league and Copa del Rey at Madrid.
“We’ve decided to bring our relationship to an end,” said Perez. “Nobody’s been sacked, it’s a mutual agreement.”
Real are currently 13 points behind Barcelona in the league and were beaten by city rivals Atletico in the Spanish Cup final last Friday.
They also lost in the semi-finals of the Champions League in each of their three seasons under Mourinho.
Real Madrid have two games left this season. They are away at Real Sociedad on 26 May, with Mourinho taking charge at the Bernabeu for the final time on 1 June against Osasuna.
“The club and manager agree the timing is right to bring our relationship to an end,” Perez added.
Champions League: 2004 (Porto), 2010 (Inter Milan)
Uefa Cup: 2003 (Porto)
Premier League: 2005, 2006 (Chelsea)
FA Cup: 2007 (Chelsea)
League Cup: 2005, 2007 (Chelsea)
La Liga: 2012 (Real Madrid)
Copa del Rey: 2011 (Real Madrid)
Serie A: 2009, 2010 (Inter Milan)
Coppa Italia: 2010 (Inter Milan)
Primeira Liga: 2003, 2004 (Porto)
Taca de Portugal: 2003 (Porto)
“On behalf of the board of directors, I would like to thank Jose Mourinho for all his hard work.
“The team has improved in his three years and we wish him all the best.”
Real had not won a trophy in the two years preceding Mourinho’s appointment.
His deal was scheduled to run until 2016 after he had signed a contract extension following last season’s La Liga success.
An agreement has been made on his exit now though, with fellow former Chelsea boss Carlo Ancelotti tipped to replace him after he expressed his desire to make the switch to the Bernabeu.
Source BBC Sport