The former Real Madrid boss took charge of Iran in April 2011 and led the team to the 2014 World Cup in Brazil.
Under Queiroz's stewardship, Iran also made the quarter-finals of the Asian Cup in Australia earlier this year, where they were defeated on penalties by Iraq.
Following a 3-1 friendly defeat to Sweden on Tuesday, the Portuguese opted to end his tenure.
"After four years of work with the national team, I am proud of the team and the individual players," Queiroz said.
"Now I am sad to leave the team, but that's life and I'm happy to be moving forward."
Queiroz, a former Manchester United assistant manager, had penned a contract to remain as Iran coach until the 2018 World Cup in September.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.