The saga of Carlos Queiroz's time in charge of the Iranian national side has taken a fresh twist with the Portuguese coach making a sudden u-turn to lead the team's 2018 World Cup campaign.
Queiroz, a former Real Madrid boss and ex-assistant to Alex Ferguson at Manchester United, announced last month that he was quitting the Iran job, citing unspecified "pressures".
The 62-year-old has since been involved in a squabble over taxes that, days after quitting, saw him stopped from leaving Tehran's Imam Khomeini International Airport with his players.
But Iranian media reported Sunday that Queiroz will stay for the qualification campaign for the 2018 finals in Russia, ending a battle between the football federation and the sports ministry.
"Anyone who doesn't like this can leave the federation since the ministry has concluded to continue with Queiroz," said Reza Hosnikhu, an official who was picked to mediate the dispute.
"Harmony" must now prevail, he told reporters.
Signup to our newsletter and follow us on Facebook and Twitter!
Queiroz, who is very popular with Iranian fans, had in the summer before the Brazil finals spoken of not having enough support from the ministry for training camps and other essential preparations.
And Ali Kafashian, president of the Iran Football Federation, on March 20 announced the team's relationship with Queiroz was over after four years in charge.
However, weeks of talks to try and resolve differences have since taken place, leading to a final reconciliation meeting on Saturday, according to the English-language Tehran Times.
Kafashian was quoted in Sunday's edition of the newspaper as saying: "Fortunately everything has been resolved and Mr Queiroz will prepare the national team for World Cup 2018. Our goal is to reach the last 16."
On the tax matter -- under Queiroz's contract the federation is supposed to pay his taxes -- Kafashian added: "We will do our best to solve this problem with the help of higher officials."
Queiroz said: "It was a very positive meeting. All of the fans want their team to be in the next World Cup. All we need right now is support the federation and the ministry to prepare for big events."
Iran has been placed in Group D of Asian qualifying for World Cup 2018 and will face Oman, India, Turkmenistan and Guam.