By Matt Smith
DUBAI, Dec 13 (Reuters) - Iranians greeted the country's qualification for the World Cup and a landslide presidential vote earlier this year with equal fervour, their joy at the exit of hardliner Mahmoud Ahmadinejad matched by the thrill of a fourth trip to soccer's showpiece.
Six months on from June's street parties and the mood in Iran remains upbeat following the election of moderate Hassan Rouhani and a breakthrough agreement that could resolve a decade-long nuclear dispute and ultimately lead to the lifting of crippling sanctions.
In a country where soccer is the number one sport and crowds at international matches regularly top 90,000, a relatively kind World Cup draw also has fans optimistic that Team Melli - coached by former Real Madrid trainer Carlos Queiroz - can claim their first win at the finals since 1998.
Then, Iran beat long-standing political foe the United States 2-1. The enmity between the two countries remains, with Washington the main architect of a punishing sanctions regime that has ravaged Iran's economy, but some Iranian fans hope a good showing in Brazil can bolster international perceptions of their country.
"Football has a unique standing in society - people believe with the election and Iran qualifying that things are getting better," said Human Afazeli, Iran assistant coach at the 2006 World Cup. "It was a very good feeling for people."
Iran, 45th in FIFA's world rankings and Asia's top-rated side, have been drawn against two-times winners Argentina, reigning African champions Nigeria and tournament debutants Bosnia.
Argentina, who can call on four-time Ballon d'Or winner Lionel Messi, will be favourites to top the group, but Iran should pose a stern test for Nigeria, 36th in the world rankings, and Bosnia, 21st.
"The decisive game will be the opener against Nigeria - if we play well it will give confidence, but if we lose it will be very tough," said Afazeli.
He speaks from experience after Iran's disappointment in 2006. A team packed with players from European leagues lost to Mexico and Portugal before earning a 1-1 draw against Angola. The team also went out in the first round in 1978 and 1998.
"At our last two World Cups we were not prepared organisationally to seize the opportunity," said Afazeli. "Now, we have excellent organisation, especially defensively. That will really help us in Brazil because we're underdogs."
On supporter forums, most fans agreed Iran were outsiders to reach the second round, but were also confident of springing a surprise, especially as Iran will play Nigeria in Curitiba, which like Tehran stands about a kilometre above sea level.
Iran won its last three qualifiers to reach Brazil, including a decisive 1-0 victory at Asian powerhouse South Korea, and while fans may be proud of their team's recent achievements the mood a year earlier was distinctly different.
Coach Queiroz arrived in Tehran in 2011 after a troubled stint in charge of his native Portugal, the Seleccao failing to score in three of four games at the 2010 World Cup as they limped out in the second round.
Queiroz's caution did not endear him to fans in South Africa and Iranians were soon grumbling about his tactics too.
In the fourth round of World Cup qualifiers in Asia, Iran had seven points from their first five matches - scoring two goals in the process - to languish outside the qualifying positions. That run included a humiliating 1-0 defeat to Lebanon.
"That created a lot of hostility against the coach and the team," said Majeed Panahi, 55, creator of fan website www.teammelli.com.
Reports in Iran claimed Queiroz was close to resigning. He had problems with his counterparts at Iran's club sides and was lambasted by fans and the media for not being interested in the domestic league and spending too much time outside Iran.
But Queiroz's decision to scour Iran's diaspora for new players was vindicated, with Standard Liege's Reza Ghoochannejhad netting three goals in five qualifying matches to aid the recovery.
The 26-year-old was born in Iran's second city Mashhad, but later moved with his family to the Netherlands and represented the Oranje at various age levels before switching allegiance.
Fulham midfielder Ashkan Dejagah, 27, scored twice on his Iran debut against Qatar, having played for Germany's youth teams.
"The media and coaches in Iran weren't happy, but fans want someone who will fight for the country and the flag and you can see that in players like Dejagah and Reza," said Afazeli.
This pair, plus midfielder Andranik Teymourian and captain Javad Nekounam - runner-up for 2013 Asian Player of the Year - will be Iran's key players in Brazil.
Iran has a long soccer history, having been introduced by British expatriates in the Victorian era.
"Football is part of the culture and for Iranians outside Iran, football offers a link back to their roots," said Afazeli. "People can stick together whatever their cultural background or political ideas and feel they're united."
Soccer's preeminence is despite Iran's wrestling and weightlifting teams winning eight Olympic golds since 2000.
The country claimed three consecutive Asian soccer titles from 1968 to 1976 - the first of which included a 2-1 win against defending champions Israel - and qualified for the 1978 World Cup where they secured a 1-1 draw against Scotland.
Following the 1979 revolution, soccer withered under Ayatollah Ruhollah Khomeini and the Iran-Iraq war of 1980-88.
"There was a lot of government interference in football - players were forced to do things like carry Khomeini's picture in the stadium and wear shirts with slogans on," said Panahi.
Iran withdrew from the qualifiers for the 1982 World Cup after FIFA ordered the country to play its home fixtures on neutral territory, also boycotting the 1986 competition.
Things improved with the creation of a new national league in 1989 and third place at the 1996 Asian Cup was the prelude to Iran's return to the World Cup finals two years later. (Reporting by Matt Smith. Editing by Patrick Johnston)