Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

TEHRAN — Iran's President Hassan Rouhani won reelection in a landslide Saturday, decisively defeating his hardline opponent Ebrahim Raisi.

State television congratulated the moderate cleric, who led with 58.6 percent of the vote. That compared with 39.8 percent for his main challenger, Raisi, a conservative judge who was widely backed by religious conservatives and supports a strict enforcement of Shariah law.

Rouhani said the election result shows that Iran wants to push ahead with reforms and continue interaction with the international community, Reuters reported.

In his speech delivered shortly after winning reelection, the moderate leader praised former President Mohammad Khatami — defying regulation that bans mention of the reformist leader or printing his pictures, according to the news agency.

Related: Iranian Women Fear Gains Will Be Lost at the Ballot Box

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"Today, the world knows well that the Iranian nation is on a civilized course with the international community. Away from radicalism, our nation wants to live in this world in friendship," Rouhani said during a televised speech in the capital of Tehran. "But we are not ready to be belittled and threatened. This is the most important message that our nation desires, and we hope all nations — both our regional neighbors and great powers — hears this."

Rouhani has slowly expanded social freedoms since taking office in 2013, and actively courted the support of young, urban and female voters.

Supporters of newly re-elected Iranian President Hassan Rouhani dance during a gathering to celebrate his victory at the Vanak square in downtown Tehran on Saturday. Behrouz Mehri / AFP - Getty Images

Early in the campaign, the 68-year-old incumbent posted a photo on Instagram showing himself out on a snowy hike, stopping to pose for a photo with two young women — both of whom had their hijabs, or headscarfs, pushed much further back then would be considered proper by hardliners.

While the president's powers are curtailed by those of Supreme Leader Ayatollah Ali Khamenei who outranks him, the scale of the victory boosts his pro-reform camp.

Related: Economy Is Focus as Rouhani Faces Raisi

While his reelection will help safeguard the pivotal 2015 nuclear agreement curtailing Iran's nuclear program in exchange for an easing of international sanctions, Rouhani will have to navigate a difficult relationship with the U.S., which helped lead the talks.

President Donald Trump has repeatedly described the nuclear pact as "one of the worst deals ever signed." Still, his administration re-authorized waivers from sanctions this week.

Also on Saturday, Trump arrived in Saudi Arabia to much fanfare. The Saudis are Iran's biggest rivals, blaming Tehran for fomenting unrest and war in Syria, Iraq and Yemen, and are vehemently opposed to the nuclear deal.

Related: Young Liberal Voters Voice Fears and Concerns

"This is an internal Iranian matter," Saudi Arabian Minister of Foreign Affairs Adel bin Ahmed Al-Jubeir said of the election result during a joint U.S. briefing with reporters Saturday night. "Who they choose for president is their business, as it should be. We judge Iran by actions, not words."

More than 56 million people were eligible to vote at over 63,000 polling places across Iran.