Real president Florentino Perez made the announcement in a special press conference at the Bernabeu stadium on Monday evening.
He also said that presidential elections would be held on June 16 and that he would run for the post again.
"We've decided to bring our relationship with manager Jose Mourinho to an end at the end of the current season," Perez said. "The club and the manager have agreed the time is right to bring our relationship to an end.
"Nobody has been sacked, it's by mutual agreement. And we have no pre-contract signed with any managerial candidate - it's something we'll look at in the coming days.
"When someone leaves Real Madrid there is something they are not happy about. But after three years it was the right time and we thank him for all his hard work."
Mourinho joined Real Madrid in the summer of 2010, winning the Copa del Rey in his first season and the Liga title the following campaign.
But Real will end this season without major silverware following Friday's defeat by city rivals Atletico Madrid in the Copa del Rey final.
Portuguese Mourinho, who has done little to contradict reports he will return to Premier League club Chelsea next season, said it had been a "disastrous" campaign and his "worst ever" as a coach.
Chelsea will part ways with interim boss Rafael Benitez, who is expected to join Napoli, and the majority of the club's fans are keen on Mourinho to return.
Paris St Germain's boss Carlo Ancelotti has been widely tipped as Mourinho's successor, and the Italian has told the French side he wants to leave.
Mourinho was widely praised for breaking Barcelona's dominance of the Spanish Liga last season after joining from Internazionale, with whom he won a domestic and European treble.
But he has had a fractious relationship with the Spanish media, league officials and even his own colleagues, falling out with several players including Real and Spain captain Iker Casillas.
Failing to win the Champions League is also a sore point for Real, although Mourinho has taken them to the semi-finals in each of his three seasons - the club had failed to pass the second round of the competition for six consecutive seasons previously.
Perez did reserve special praise for that feat, saying Mourinho "brought us back to a higher level". He also added that the former Porto boss had returned a "culture of winning" to the club, and that he "would have liked Mourinho to continue" in his post.
Real have reportedly approached Ligue 1 champions PSG regarding coach Ancelotti, who like Mourinho is a former Chelsea manager. The Italian has asked PSG for permission to leave for Real, who despite the riches of the Qatari-owned French club are still considered a bigger draw. Real have denied this speculation.
Whether Chelsea is Mourinho's next destination remains to be seen though - while he is still hugely popular with the Blues faithful, Mourinho may view replacing Ancelotti at PSG as a greater challenge, while Manchester City have not yet formally approached Malaga over their coach, former Real boss Manuel Pellegrini.
Either way, the tempestuous spell at the Bernabeu is over, and one of the most highly-rated managers in world football on the lookout for a new job.