Last updated on .From the section Football

Real Madrid have announced that head coach Jose Mourinho will leave the club at the end of the season after three years in charge of the Spanish giants.

Real Madrid president Florentino Perez broke the news at a packed news conference on Monday.

Real Madrid confirm Mourinho will leave

The 50-year-old Mourinho, who has been linked with a return to Chelsea, won the league and Copa del Rey at Madrid.

"Nobody's been sacked, it's a mutual agreement," said Perez. "We've decided to bring our relationship to an end."

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 former Porto and Inter Milan boss Mourinho.

Real Madrid have two games left this season. external-link They are away at Real Sociedad on 26 May before Mourinho takes 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. "On behalf of the board of directors, I would like to thank Jose Mourinho for all his hard work.

Mourinho's honours 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)

"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.

Perez denied a replacement had been lined up to take over from Mourinho.

"We have no pre-contract signed with any managerial candidate," he said. "It's something we'll have to look at in the coming days."

Ancelotti, 53, has already asked to leave Paris St-Germain but the Ligue 1 champions insist the Italian is still under contract.

Analysis - 5 live's Ian McGarry "It's a big leap of faith on Chelsea owner Roman Abramovich's part to bring Mourinho back. Let's face it, they parted on very bad terms. "But Mourinho is box office and loves the media spotlight, although I think he's romanticised the relationship with the British media a little. "It wasn't as cushty as he's made out in press conferences over the last few months, when he said he is loved by fans and the media. "I think it will be a very different landscape he returns to and a very different Chelsea team. Chelsea have evolved since he was here."

Mourinho's failure to win any trophies this season appears to have accelerated his departure from Madrid.

The Portuguese, who left Inter Milan for Real in 2010 after guiding the Italians to the Champions League crown, has labelled this season "the worst of my career".

Mourinho finished second in La Liga in his first season - four points behind Barcelona - but won the title a year later, amassing a record 100 points in the process. external-link

However, this season Mourinho has cast a sulky figure. He has argued with established players, such as Iker Casillas, Sergio Ramos and Pepe, and was sent from the dugout for protesting a referee's decision during the Copa del Rey defeat to Atletico.

Ancelotti's achievements Juventus: Intertoto Cup 1999 AC Milan: Coppa Italia 2003; Champions League 2003, 2007; Uefa Super Cup 2003, 2007; Serie A 2004; Supercoppa Italiana 2004; Fifa Club World Cup 2007 Chelsea: Community Shield 2009; Premier League 2010; FA Cup 2010 PSG: Ligue 1 2013

Following Real's Champions League elimination by Borussia Dortmund, he hinted at a return to Chelsea.

"I know in England I am loved," he said. "I know I am loved by some clubs, especially one."

Mourinho won two consecutive Premier League titles during his three-year spell at Chelsea, which ended in September 2007, also lifting the League Cup twice and the FA Cup once.

During his tenure at Stamford Bridge, Mourinho won 124 of his 185 games in charge, including a 60-game unbeaten run at home in the league before surprisingly leaving the club in September 2007.