The man today declared as Iran's next president grew up in Glasgow, completing a degree and doctorate at Glasgow Caledonian University.

Hassan Rouhani, an avowed reformer, urged to a wide lead in early vote counting today, and the country's interior minister declared him the victor at 5pm today.

He studied at the old Glasgow Polytechnic (now GCU) in the 1970s and returned to undertake a law doctorate in the 1990s. He then went by the name of Hassan Feridon

Mr Rouhani, 64, who is married with children, is a cleric who speaks English, German, French, Russian and Arabic.

Earlier today, he had more than 51% of the more than eight million votes tallied so far, well ahead of Tehran Mayor Mohammad Bagher Qalibaf with about 16.6%. Hard-line nuclear negotiator Saeed Jalili was third with about 13%.

The strong margin for Mr Rouhani gave him an outright victory and avoided a two-person run-off next Friday. Iran has more than 50 million eligible voters, and turnout in yesterday's poll was believed to be high.

Many reform-minded Iranians who have faced years of crackdowns looked to Mr Rouhani's rising fortunes as a chance to claw back a bit of ground.

While Iran's presidential elections offer a window into the political pecking orders and security grip inside the country - particularly since the chaos from a disputed outcome in 2009 - they lack the drama of truly high stakes as the country's ruling clerics and their military guardians remain the ultimate powers.

Election officials began the ballot count after voters queued for hours in wilting heat at some polling stations in central Tehran and other cities, while others cast ballots across the vast country from desert outposts to Gulf seaports and nomad pastures.

Voting was extended by five hours to meet demand, but also as possible political stagecraft to showcase the participation.

The apparent strong turnout - estimated at 75% by the hard-line newspaper Kayhan - suggested that liberals and others abandoned a planned boycott as the election was transformed into a showdown across the Islamic Republic's political divide.

On one side were hard-liners looking to cement their control behind candidates such as Mr Jalili, who says he is "100%" against detente with Iran's foes, or Mr Qalibaf.

Opposing them were reformists and others rallying behind the "purple wave" campaign of Mr Rouhani, the lone relative moderate left in the race.

Officials did not say in which parts of the country the ballots were counted.

But even Mr Rouhani's presidency could be more of a limited victory than a deep shake-up.

Iran's establishment - a tight alliance of the ruling clerics and the ultra-powerful Revolutionary Guard - still holds all the effective power and sets the agenda on all major decisions such as Iran's nuclear programme and its dealings with the West.

Security forces are also in firm control after waves of arrests and relentless pressures since the last presidential election in 2009, which unleashed massive protests over claims that the outcome was rigged to keep the combative Mahmoud Ahmadinejad in power for a second and final term. He is barred from seeking a third consecutive run.

The greater comfort level by the theocracy and Revolutionary Guard sets a different tone this time. Opposition groups appear too intimidated and fragmented to revive street demonstrations, and even a win by Mr Rouhani - the only cleric in the race - is not likely to be perceived as a threat to the ruling structure.

Mr Rouhani led the influential Supreme National Security Council and was given the highly sensitive nuclear envoy role in 2003, a year after Iran's 20-year-old atomic programme was revealed.

"Rouhani is not an outsider and any gains by him do not mean the system is weak or that there are serious cracks," said Rasool Nafisi, an Iranian affairs analyst at Strayer University in Virginia. "The ruling system has made sure that no-one on the ballot is going to shake things up."

Yet a Rouhani victory would not be entirely without significance either. It would make room for more moderate voices in Iranian political dialogue and display their resilience.

It also would bring onto the world stage an Iranian president who has publicly endorsed more outreach rather than bombast toward the West.

The last campaign events for Mr Rouhani carried chants that had been bottled up for years.

Some supporters called for the release of political prisoners including opposition leaders Mir Hossein Mousavi and Mahdi Karroubi, both candidates in 2009 and now under house arrest. "Long live reforms," some cried at Mr Rowhani's last rally, which was awash with purple banners and scarves - the campaign's signature hue in a nod to the single-colour identity of Mr Mousavi's now-crushed Green Movement.

"My mother and I both voted for Rouhani," said Saeed Joorabchi, a university student in geography, after casting ballots at a mosque in west Tehran.

In the Persian Gulf city of Bandar Abbas, local journalist Ali Reza Khorshidzadeh said many polling stations had significant lines and many voters appeared to back Mr Rouhani.

Just a week ago, Mr Rowhani was seen as overshadowed by candidates with far deeper ties to the current power structure: Mr Jalili and Mr Qalibaf, who was boosted by a reputation as a steady hand for Iran's sanctions-wracked economy.

Then a moderate rival of Mr Rouhani bowed out of the presidential race to consolidate the pro-reform camp. That opened the way for high-profile endorsements including his political mentor, former president Akbar Heshmi Rafsanjani, who won admiration from opposition forces for denouncing the post-election crackdowns in 2009. This, too, may have led to Mr Rafsanjani being blackballed from the ballot this year by Iran's election overseers, which allowed just eight candidates among more than 680 hopefuls.

Iran has no credible political polling to serve as harder metrics for the street buzz around candidates, who need more than 50% of the vote to seal victory and avoid a run-off. Journalists face limits on reporting such as requiring permission to travel around the country. Iran does not allow outside election observers.

Yet it is clear that fervour remains strong for Mr Rouhani's rivals as well.

Mr Qalibaf is riding on his image as a capable fiscal manager who can deal with the deepening problems of Iran's economy and sinking currency.

Mr Jalili draws support from hard-line factions such as the Revolutionary Guard's paramilitary corps, the Basij. His reputation is further enhanced by a battlefield injury that cost him the lower part of his right leg during Iran's 1980-88 war with Saddam Hussein's Iraq, which at the time was backed by the United States.

"We should resist the West," said Tehran taxi driver Hasan Ghasemi, who supported Mr Jalili.

Iran's supreme leader, Ayatollah Ali Khamenei, has not publicly endorsed a successor for Mr Ahmadinejad following their falling out over the president's attempts to challenge Ayatollah Khamenei's near-absolute powers.

Mr Ahmadinejad leaves office weakened and outcast by his political battles with Ayatollah Khamenei - yet another sign of where real power rests in Iran. The election overseers also rejected Mr Ahmadinejad's protege, Esfandiar Rahim Mashaei ,in apparent payback. The usually talkative Mr Ahmadinejad gave only a brief statement to reporters as he voted and refused to discuss the election.

Ayatollah Khamenei remained mum on his own choice as he cast his ballot. He added that even his children do not know whom he backs.

Instead, he blasted the US for its repeated criticism of Iran's crackdowns on the opposition and the rejection of Mr Rafsanjani and other moderates from the ballot.

"Recently I have heard that a US security official has said they do not accept this election," Ayatollah Khamenei was quoted by state TV as saying after casting his vote. "OK, the hell with you."

Iran's state media hailed the apparently high turnout as a boost for the Islamic Republic's political system.

"A great political epic has shocked the world," read a front-page headline in the hardline daily Kayhan today. Ayatollah Khamenei had called for a "political epic" on June 14, saying a high turnout would protect Iran against its enemies.

By many measures, this election is far removed from the backdrop four years ago.

Iran's security networks have consolidated near-blanket control, ranging from swift crackdowns on any public dissent to cyberpolice blocking opposition Internet websites and social media. Hackers calling themselves the Iranian Cyber Army disrupted at least a half dozen reform-oriented websites, including one run by well-known political cartoonist Nikahang Kosar.

Prominent reformist politician Mostafa Tajzadeh, who was jailed after the 2009 disputed election, voted from his cell in Tehran's Evin Prison, the semi-official Isna news agency reported.

The economy, too, is under far more pressure than in 2009.

Western sanctions over Iran's nuclear programme have shrunk vital oil sales and are leaving the country isolated from international banking systems. New US measures taking effect on July 1 further target Iran's currency, the rial, which has lost half of its foreign exchange value in the past year, driving prices of food and consumer goods sharply higher.

Outside Iran, votes were casts by the country's huge diaspora including Dubai, London and points across the United States.

"I hope we take a step toward democracy," said Behza Khajavi, a 29-year-old doctoral candidate in physics from Boca Raton, Florida, as he voted in Tampa for Mr Rouhani.

In Paris, a 25-year-old Iranian student, Sohrab Labib, voted at his nation's consulate while a small group of protesters gathered across the street.

"It's our country. It's our future," he said. "In any case, even a little change could influence our future."