For all the focus on foreign policy in this campaign, neither presidential candidate has spent much time explaining what may loom as the largest new challenge after Tuesday: what to do about Iran.

The United States faces a major test with Tehran over its nuclear program just three weeks after the U.S. election. Yet neither candidate has addressed the growing prospects that diplomacy may not work, that the world may be too divided to agree on punitive sanctions, and that military options, after Iraq, could spark major new domestic and international controversy.

And short of a new deal with Iran, a new president could face a showdown at the United Nations about the time of the inauguration in January, foreign policy analysts warn.

In the campaign, President Bush and Democratic candidate John F. Kerry have vowed to prevent Iran from converting its peaceful energy program into a nuclear weapons program. Beyond that, the difference between their positions is more subtle than substantive. Each has issued ultimatums and pressed for diplomacy.

Unable to issue a formal policy for four years because of internal divisions in his administration, Bush has long maintained a confrontational stance on Iran, a country he has called one of three in the "axis of evil." Only reluctantly has he recently agreed to let European leaders offer Iran a compromise to end the standoff. The deadline for an answer is Nov. 25, the next meeting of the International Atomic Energy Agency.

But the Bush administration has already concluded that Iran will not accept the deal -- to scrap its own uranium enrichment in exchange for nuclear technology and fuel controlled by the outside world -- forcing the United States to press for international action at the United Nations.

"We believe that the Iranians are going to have to be referred to the Security Council because, when they refuse to live up to their obligations, that is the course that is prescribed," national security adviser Condoleezza Rice told the American Israel Public Affairs Committee on Monday.

In the second debate, Kerry pledged to "lead the world in the greatest counterproliferation effort. And if we have to get tough with Iran, believe me, we will get tough."

In a slight variation from Bush, Kerry earlier said that the United States, rather than Britain, France and Germany, should have initiated negotiations to curb Iran's nuclear potential. "I believe we could have done better. I think the United States should have offered the opportunity to provide the nuclear fuel, test them, see whether or not they were actually looking for it for peaceful purposes. If they weren't willing to work a deal, then we could have put sanctions together," he said in the first debate.

Kerry foreign policy adviser Richard C. Holbrooke, a former U.N. ambassador, told the AIPAC conference this week that the current European initiative is "self-evidently not going to ever succeed. And anyone who's worked with the Europeans knows this."

The Iran nuclear issue looms as the next big foreign policy challenge because it is "a crucial test of whether it is possible, by means short of the use of military force, to prevent a resourceful and determined country from acquiring nuclear weapons," said Robert J. Einhorn, former assistant secretary of state for nonproliferation, who is now at the Center for Strategic and International Studies.

But whoever wins the election is likely to quickly face problems, foreign policy analysts warn. Unless a last-minute deal emerges, they say the United States will have to do serious arm-twisting to get the minimum number of votes at the IAEA to refer Iran to the United Nations.

Iran has become a symbol for a growing number of developing nations, such as Brazil, that want nuclear energy -- and control over their own fuel-production cycles without international intervention. Many Third World countries sympathize with Tehran's position that it will never permanently surrender the right to enrich uranium for nuclear energy, which the United States agrees is not illegal under the Non-Proliferation Treaty.

Neither candidate has developed a detailed strategy on this broader aspect of proliferation, which Washington could be dealing with for decades in many countries, foreign policy analysts say. Unless Washington outlines a policy that applies globally, they add, an agreement with Iran could prove elusive because Tehran leaders argue theirs is the only country being deprived of a legal right and a technology important for peaceful development in the 21st century.

But even if the United States does prevail at the IAEA, it could face a "high-stakes confrontation" against other veto-wielding members at the United Nations about the time of the inauguration, Einhorn said. Any drastic measure, such as an oil embargo, will also be "impossible," he added, because of shifting global economic realities and Iran's leverage. China buys 17 percent of its oil from Iran and European Union countries buy almost 7 percent, oil analysts say.

"Taking this to the Security Council is not going to solve much because it is unlikely to vote serious sanctions against Iran," said Shaul Bakhash, an Iran specialist at George Mason University and author of "The Reign of the Ayatollahs." "China depends on Iran for large amounts of oil and is eager to secure supplies for years to come, so it won't go along with sanctions."

The best the next president may initially achieve is U.N. pressure on Iran to be more cooperative with the IAEA, which analysts say would probably have minimal impact on Tehran.

Staff writer Glenn Kessler contributed to this report.