TEHRAN, Iran — Moderate cleric Hasan Rowhani was declared the winner of Iran’s presidential vote on Saturday after gaining support among many reform-minded Iranians looking to claw back a bit of ground after years of crackdowns.

The powerful showing by the former nuclear negotiator allowed him to avoid a two-person runoff and demonstrated the strength of opposition sentiment even in a system that is gamed against it. The ruling clerics barred from the race reform candidates seen as too prominent, allowing a list of hopefuls who were mainly staunch loyalists of the supreme leader.

But the opposition settled on Rowhani as the least objectionable of the bunch, making him the de facto reform candidate.

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.

Security forces also are in firm control after waves of arrests and relentless pressures since the last presidential election in 2009, which unleashed massive protests over claims 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. However the last-moment surge around Rowhani injected some excitement in the race.

Rowhani won with 50.7 percent of the more than 36 million votes cast, the Interior Ministry reported, well ahead of Tehran Mayor Mohammad Bagher Qalibaf with about 16.5 percent. Hard-line nuclear negotiator Saeed Jalili came in third with 11.3 percent followed by conservative Mohsen Rezaei with 10.6 percent.

Minister Mostafa Mohammad Najjar said the turnout was 72.7 percent, suggesting that liberals and others abandoned a planned boycott as the election was transformed into a showdown across the Islamic Republic’s political divide. Iran has more than 50 million eligible voters.

Voters waited on line for hours in wilting heat Friday at some polling stations in downtown 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.