Chelsea will not have to pay compensation for José Mourinho after Real Madrid confirmed that the Portuguese manager will leave the Bernabéu at the end of the season by mutual consent. Nothing now stands in the way of Chelsea and Mourinho formalising an agreement that was reached in principle months ago.

The 50-year-old, whose position at Madrid had become untenable, has long been preparing for next season at Stamford Bridge – preparations that include contacting potential signings. Chelsea hope to confirm his reappointment in the middle of next month.

Madrid's president, Florentino Pérez, called a meeting with Mourinho at the club's Valdebebas training ground on Monday morning during which the two agreed to bring an end to the coach's contract, which was due to expire in 2016, after the final game of the season on 1 June. That decision was then ratified by the board in the afternoon and made public at a press conference at the Bernabéu at 8pm. Pérez said that no compensation would be payable either by coach or club.

Madrid's president said: "No one has been sacked." He also said that he would have liked Mourinho to have continued but that the pressure at Real Madrid meant that the time had come to end the relationship.

"Sometimes the pressure here goes beyond the normal," he said. "And Mourinho has been here for three years: that makes him the longest-serving manager in the first division."

Pérez admitted that Madrid had asked Paris Saint-Germain for permission to talk to Carlo Ancelotti but the approach had been turned down. On Sunday night it was confirmed that Ancelotti had told PSG that he wanted to leave to take over at Madrid.

A clause in Mourinho's deal stipulated a penalty, thought to be in the region of €20m (£16.9m), in the event of one of the parties unilaterally breaking the contract. Roman Abramovich, Chelsea's owner, had told Mourinho that he would not pay and that any costs involved in getting out of his contract at Madrid were the coach's responsibility. Chelsea have been stung in the past having paid £13.5m to secure André Villas-Boas from Porto in the summer of 2011, only to sack him after 256 days in charge. Mourinho, too, wished to avoid the cost of departing.

With Madrid and Mourinho effectively waiting for each other to make a move, yet also aware that his departure was best for both parties, the coach had been increasing the pressure in recent weeks to ensure that Madrid did not hold him to that deal.

The conflict was constant as he pursued a familiar exit strategy. In one recent press conference Mourinho said he was considering staying – a remark meant not as a promise but a threat. He had also insisted that he did not want to be paid for "a single day more" than he worked at the club.

The logical and least damaging solution was an agreement to terminate the contract by mutual consent and that is what Madrid communicated on Monday night. "We had a frank conversation, we analysed a number of things, and we took the decision that after three years it was time to end the relationship," Pérez said. "It is never nice when you have to leave but we thought it was the right decision."

Asked if either side was liable to pay any compensation, Pérez said: "No. Mourinho said that in a press conference and I reiterate it."

Pérez, who also announced that he will be calling presidential elections for June 16 and that he intends to stand, added: "The balance of Mourinho's time here is positive. We have made a very important qualitative leap and we are back where this club should be. For six years we were knocked out at the last 16 of the Champions League and were not even seeds. We have now been semi-finalists three years in a row.

"Maybe for mere mortals that would be enough but not for a club like us. We are not satisfied because this club is so demanding but you have to look at where we came from. The word failure is not appropriate."

The Chelsea goalkeeper Petr Cech hopes a deal for Mourinho can be sealed swiftly. "The earlier he can be here, the earlier he can start working on things, and he won't leave it to the last moment," he said. "But it has been the same at this club every year, and they know how to deal with situations like that."

John Terry was not included in the Chelsea squad that has travelled to the US to play Manchester City in St Louis and New York, as he continues to receive treatment on an ankle injury.