Whoever wins this November's presidential election, the United States faces an urgent question that the Bush administration has not resolved: What is America's strategy for coping with the rising power of Iran?

Washington and Tehran have had extensive secret contacts since Sept. 11 -- premised on their shared goal of destroying al Qaeda and the Taliban in Afghanistan and Saddam Hussein in Iraq. Despite many meetings, nothing has come of the contacts -- partly because the Bush administration, not for the first time, was internally divided over the right strategic course.

What's poignant about these wary U.S.-Iranian feelers is that just over a year ago, they yielded a plan for an "anti-terrorist" deal that both countries should have loved: Iran would hand over some senior al Qaeda operatives in its custody and the United States would transfer to Iran some prisoners it was holding from the Iraqi-backed Mujaheddin-e Khalq organization, a group America has officially branded as terrorist.

The State Department is said to have favored such a deal, but the Pentagon balked -- arguing that the Mujaheddin-e Khalq might be useful in fomenting regime change in Tehran. Sadly, this internal dispute between administration pragmatists and ideologues over Iran is similar to the feuds that have obstructed policy on North Korea and Iraq.

To understand why Iran is such an interesting case study of lost opportunities, a little background is necessary. The following account is drawn from current Iranian officials, former U.S. officials and other sources.

The U.S.-Iranian dialogue began in earnest after Sept. 11. The initial intermediary was U.N. official Lakhdar Brahimi, the same man who recently served as special envoy in Iraq. The U.S. representative was often Ryan Crocker, one of the State Department's top Middle East experts.

During and immediately after the Afghanistan war, meetings were held at least once a month. One former U.S. official says flatly that without Iranian help, it would have been impossible to establish the new government in Afghanistan under President Hamid Karzai.

A new issue arose as al Qaeda operatives fled from Afghanistan into Iran after the war. The Iranians arrested more than 500 of them in late 2001 and early 2002, according to one senior Iranian official. He said Tehran transferred many to be interrogated in their countries of origin, including Saudi Arabia, Pakistan, Italy and the Netherlands. A number of al Qaeda operatives charged with mounting terrorist attacks in Iran remained there, and they will be tried in Iranian courts later this year.

A second group of high-level al Qaeda leaders crossed into Iran's remote Baluchistan province in the spring of 2002. U.S. intelligence officials believed this group included Osama bin Laden's security chief, Saif Adel, and one of his sons, Saad bin Laden. The administration badly wanted to interrogate them outside Iran.

But the Iranians had a demand of their own, which ripened after the United States toppled Saddam Hussein's regime in April 2003. About 4,000 members of the Mujaheddin-e Khalq had been captured at their bases in Iraq, which they had used for years to conduct attacks against Iran. Though the group's members were officially terrorists, the administration was wary about turning them over to Tehran. (Bush's own initial reaction is said to have been "Why not? They're terrorists.")

In a secret meeting in May in Geneva, the two sides explored an exchange of the "terrorist" captives. To assuage U.S. human rights worries, Iranians pledged to grant amnesty to most of the 4,000 Mujaheddin-e Khalq captives, to forgo the death penalty for about 65 leaders who would be tried in Iranian courts and to allow the International Committee of the Red Cross to supervise the transfer.

The Bush administration ultimately rejected this exchange, bowing to neoconservatives at the Pentagon who hoped to use the Mujaheddin-e Khalq against Tehran. Some administration officials were disappointed: "Why we didn't cut this deal is beyond me," says Flynt Leverett, who was in charge of Middle East policy for the National Security Council until last spring.

The secret contacts were broken off in late May 2003, when U.S. intelligence reports suggested that some of the senior al Qaeda operatives in Iran had helped plan a bombing that month in Riyadh, Saudi Arabia. In the year since, Iranian hard-liners have crushed reformers there and pushed ahead with their program to acquire nuclear weapons.

Finding the right strategy for dealing with an Iran that has nuclear ambitions and terrorist capabilities won't be easy. But Iranians and Americans who were involved in the secret dialogue of the past few years remain convinced that the only answer is a "grand bargain" that builds on the two countries' shared interests -- and seeks to satisfy each country's security concerns. That's one item to put in the White House "in-box" for January.

davidignatius@washpost.com