Updated

Millions of joyous Iranians flooded the streets of Tehran on Tuesday after the national team beat Asia powerhouse South Korea 1-0 away to qualify for the 2014 World Cup finals in Brazil.

Men, women and children, still in party mood following the victory of moderate Hassan Rowhani in Friday's presidential election, filled the streets.

"Brazil here we come," sang the fans in football-mad Iran.

Footage aired on state television showed similar outpourings of joy around the country.

In Tehran, residents waved the green-white-red national flag while motorists honked their horns and bikers sped through the capital to join the festivities.

Some motorists were parked on the roadside with their radios turned up at full volume as passersby danced and cheered while policemen looked on.

Ehsan, 33, said he rushed outdoors "immediately after the referee blew the final whistle."

"I did not want to miss out on this party."

The win on Tuesday put Iran top of Asian qualifying Group A with 16 points followed by South Korea with 14 points. Both teams qualified for the finals.

It is the fourth time that Iran has clinched a berth at football's high feast.

"I will never forget these two happy events coming right after each other," said Ehsan referring to the football win which followed close on the heels of Rowhani's victory at the polls.

Rowhani's election ends President Mahmoud Ahmadinejad's eight years of hardline leadership that isolated the country in the international community and limited freedom at home.

The qualification was hailed by top officials.

Supreme leader Ayatollah Ali Khamenei thanked the team for bringing "happiness" to the people of Iran, state media reported.

"The national football team's victory made the people and especially sports fans happy. I thank those who created this happiness," Khamenei said.

Rowhani was equally enthusiastic.

"I am certain this victory is the prelude for major victories and the decisive presence of Islamic Iran in all fields," the newly-elected president said in remarks carried by the ISNA news agency.

On Vali Asr Street in Tehran, young men jumped up and down to express their joy.

"It was a big surprise. I could not have imagined that we could beat Korea in front of their supporters at home," said Mehran, 29.

The win provided welcome cheer for Iranians struggling with soaring inflation triggered by by EU and US sanctions targeting the oil and banking sectors to put pressure on Tehran to rein in its controversial nuclear programme.

"I hope the economic difficulties are resolved so that I can afford a ticket to go to Brazil and watch Iran play," said 28-year-old Ziba.

Holding a poster of Rowhani , 20-year-old university student Bahar said: "Iran is on a winning streak ever since Rowhani won the election."

The sport ministry said it plans to hold a ceremony at Tehran's Azadi stadium on Wednesday to mark Iran reaching the finals.

Iran made their World Cup final debut in Argentina in 1978, but failed to progress beyond the group stage.

Twenty years later they qualified for the finals in France, where they scored a memorable victory against the United States.

Iran also made it to the 2006 finals in Germany but again failed to make it beyond the group stage.