Fan favourite, Queiroz announced last month that he was quitting the Iran job due to interference and budget constraints among his reasons for leaving.
Iranian media reported on 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.
President of the Iran Football Federation, Ali Kafashian, said in March that the team's relationship with Queiroz was over after four years.
Things seem to have now changed after meetings between the two parties leading to a final reconciliation meeting on Saturday, according to the Tehran Times.
Kafashian told Sunday's edition of the newspaper: "Fortunately everything has been resolved and Mr Queiroz will prepare the national team for the World Cup 2018. Our goal is to reach the last 16."
Queiroz added: "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 are in Group D, of Asian qualifying for World Cup 2018, with Turkmenistan, India, Oman and Guam.