After more than 18 months of grueling negotiations, the United States and five other world powers are about to find out whether they can strike a deal with Iran that would open its nuclear program to unprecedented scrutiny and in return ease a punishing raft of sanctions.

Secretary of State John F. Kerry left Friday morning for the final round of talks in Vienna. The other foreign ministers will trickle in over the weekend ahead of a June 30 deadline, but negotiators acknowledge that the endgame may take a few days longer in order to work through some major differences still separating the sides.

“We always knew as we got to the end, it would get tougher and tougher, because the stakes get higher,” said a senior administration official, speaking on the condition of anonymity because of the sensitive nature of the discussions.

Technical solutions to all the outstanding issues are on the table, the official said, adding, “There are difficult political decisions for the Iranians to make.”

With negotiators on the verge of what would be a historic accord, opposition to any deal has stiffened in Washington and Tehran.

Skepticism runs deep among Republicans in Congress, who have been briefed on the negotiations by administration officials, and some have urged President Obama to consider walking away.

Anti-American rhetoric has been harsh in Tehran, where some hard-line lawmakers voted last week to ban international inspections of military sites suspected of conducting nuclear research. Any one of seven uncompromising “major red lines” laid down this week by Iran’s supreme leader, Ayatollah Ali Khamenei, who has the final say on state matters, could upend the talks.

The ambivalent and sometimes openly hostile attitude toward an agreement had been predicted, even when weary officials announced a framework agreement eight weeks ago in Lausanne, Switzerland, after marathon negotiations.

But the total collapse of talks now is considered unlikely when the governments have invested so much time and political capital.

“A lot of progress has been made,” said Kelsey Davenport, head of nonproliferation policy at the Arms Control Association. “When you consider the extremely difficult issues that have been overcome, the outstanding issues are all resolvable. It’s critical for details to be worked out in a satisfactory manner. But momentum will carry the negotiations through.”

Kerry said he has tuned out criticism that he isn’t being tough enough or that the Iranians are not willing to compromise enough.

“What matters to us is what’s agreed on within the four corners of a document,” he said Wednesday. “I have consistently said this will be determined in the last days by whether or not the outstanding issues we’ve been clear about are addressed. If they are not addressed, there won’t be a deal.”

The unresolved issues, though few, are considered essential to an agreement that would prevent Iran from cheating.

The thorniest is the degree of access that inspectors from the International Atomic Energy Agency would have to Iran’s nuclear plants and uranium mines so they can monitor whether the country is keeping its commitments. Iran is suspicious of the IAEA’s fairness and has balked at allowing inspectors into military sites.

Iran also has been reluctant to allow the IAEA to talk to its nuclear scientists. That is a crucial point as inspectors try to answer 11 remaining questions about whether Iran attempted nuclear weaponization in the past, as the United States and other countries insist happened.

Kerry has said he is not “fixated” on what Iran did in the past, but U.S. officials say that any deal must grant IAEA inspectors the necessary access to answer questions about the possible military dimensions (PMD) of Iran’s past research.

“The United States is not looking for a confession,” the senior administration official said. “We’ve made our own national judgment. But sanctions lifting will only occur as Iran takes the steps agreed on, including addressing PMD.”

The pace of sanctions relief remains a contentious issue. Khamenei demands that financial, banking and economic sanctions be lifted on the day of an agreement. Polling in Iran by the Center for International and Security Studies at the University of Maryland shows that most Iranians anticipate feeling the benefits of lifted sanctions in a year or less.

Since the Lausanne framework agreement was announced on April 2, administration officials have had dozens of briefings for members of Congress who will weigh in on a final deal.

“On the Democratic side in the Senate, there’s a true wait-and-see attitude,” said Sen. Benjamin L. Cardin (Md.), the ranking Democrat on the Senate Foreign Relations Committee, who helped craft a bipartisan bill that would allow a congressional review of a deal. “On the Republican side, clearly members are more opinionated. That was true before, during and now.”

Committee Chairman Bob Corker (R-Tenn.) sent Obama a letter this month urging him to walk away if Iran does not provide international inspectors “anytime, anywhere” access to its nuclear sites. Corker said he was alarmed by apparent American concessions.

“We’ve gone from total dismantlement to managed proliferation, so a value judgement’s going to have to be made by people,” he said. “Is giving up 20 years of different types of sanctions on Iran worth a 10-year pause?”

If a deal is concluded, a new era in U.S.-Iranian relations will not be at hand.

“When and if a deal is signed, ‘resolution’ is the wrong word to describe it,” said Karim Sadjadpour, an Iran analyst with the Carnegie Endowment for International Peace. “It’s going to signal a different phase in this conflict. Maybe it de-escalates it a bit. But it’s certainly not a resolution to the conflict.”