Updated at 10:21 a.m. ET

Iranian President Hassan Rouhani has won re-election by a large margin.

According to Iran's Interior Ministry as reported by Press TV, Rouhani won about 57% of the vote with more than 23.5 million votes against his main challenger Ebrahim Raisi's 15.7 million. Rouhani appeared to have benefited from a large turnout that forced polls to stay open until midnight, NPR's Peter Kenyon reports. More than 40 million out of 56 million eligible voters cast their ballots.

In a live speech carried by State TV, Rouhani said Saturday that the vote showed Iran's willingness to work with the international community, and a rejection of hardliners, according to the AP.

First elected in 2013, Rouhani is seen as a reformer in Iran's largely conservative society. He is best known abroad as the president who made a nuclear deal with the West in 2015, in which the country agreed to certain limits on nuclear development in return for the lifting of some sanctions.

His conservative opponent Raisi attacked the weak state of the economy under Rouhani. Raisi "lambasted Rouhani for seeking foreign investment and appealed to religious conservatives," The Guardian noted.

Massoud Asheri, a 29-year-old engineer for a mining company, told Peter that he was always confident Rouhani would prevail, and believes it's a sign that popular pressure for change is mounting.

"It's about 10 or 20 years that people in Iran want to change the condition in Iran," Asheri said. "The people now are growing, and the new generation wants new things."

But Asheri also says Iranians urgently need economic improvements.

"So I think in the next four years, Mr. Rouhani [...] must respond to the people who voted for him for the second time."

Rouhani voter Narges Sha'eri, 30, agrees that the economy tops the to-do list for Rouhani, but adds that a steady hand in dealing with the international community is also needed. She says a good deal of Rouhani's support was motivated by fear of what might happen if the hard liners regained control of the executive branch.

"Precisely that," she told Peter. "We also knew very well that should Raisi win, he would bring the same people that were of the (hard line) principalist camp, which would drive the country backward."

The lifting of sanctions did benefit the economy by increasing oil production. Iran is one of the top oil-producing countries in the world; the CIA ranked it at No. 7 in 2015. Rouhani had promised during the campaign to further undo international sanctions in a second term, Kenyon says.

But the economy is still sluggish. In mid-2016, unemployment stood at 12.7 percent, a "three-year high," according to the World Bank. NPR's Steve Inskeep reports that Rouhani "brought down inflation, but he slowed the economy while doing so."

Rouhani's reforms have been modest and gradual, as Inskeep notes. Reformist newspapers have begun publishing again and imprisoned journalists have been freed. Rouhani presided over an expansion of the country's 3G and 4G networks, used by smartphones.

But ultimate power in the country rests with Supreme Leader Ayatollah Ali Khamenei, who has held the title since 1989. Khamenei controls the country's security forces and can veto any presidential policies.

Meanwhile, U.S. President Trump arrived in Saudi Arabia Saturday morning, for a visit with the country's royal leaders. The Saudis are a strong U.S. ally and arch-enemy of Iran; the largely Sunni Saudis strongly opposed President Obama's outreach and nuclear deal with the Persian Shia power.

Despite President Trump's pledges to "rip up" the Iran deal, the Trump administration's State Department allowed the deal to continue this past week by continuing to waive sanctions on Iran.

Relations between the U.S. and Iran are likely to be remain hostile, according to Karim Sadjadpour of the Carnegie Endowment for International Peace. He told NPR's Morning Edition that leaders in the U.S.-allied countries of Israel and Saudi Arabia are likely to advocate "a policy which goes back to status quo ante on Iran which is pushing Iran back in the Middle East."

Copyright 2017 NPR. To see more, visit http://www.npr.org/.