Iranian President Mahmoud Ahmadinejad said Tuesday that he intends to release two Americans who have been jailed on charges of espionage for two years and grant them a “unilateral pardon.”

“I am helping to arrange for their release in a couple of days so they will be able to return home,” Ahmadinejad told The Washington Post in an hour-long interview at his office here.

The Americans, Shane Bauer and Josh Fattal, both 29, were arrested along with another American, Sarah Shourd, as they hiked along the Iran-Iraq border in July 2009. Last month, Bauer and Fattal were sentenced to eight years in prison.

Shourd was released in September 2010 on medical and humanitarian grounds after posting $500,000 bail.

In Washington, Secretary of State Hillary Rodham Clinton said she was “encouraged” by Ahmadinejad’s comments. There was no immediate reaction from the families of Bauer or Fattal.

The promise to free the hikers could eliminate a key flash point in relations between Iran and the United States, although many more remain. It comes just weeks before Ahmadinejad is due to visit New York for the annual U.N. General Assembly meeting, and it coincides with other conciliatory actions by Iran, including a letter to European Union officials offering new talks on Iran’s nuclear program.

It was not clear, however, whether Iran’s diplomatic outreach included the kinds of concessions that Western officials say would be necessary to resume talks that broke down in January.

In the interview Tuesday, Ahmadinejad suggested he was open to a resolution of the standoff over the country’s uranium-enrichment program, although apparent deals have fallen apart in the past.

$500,000 bail demanded

Masoud Shafiei, a lawyer representing the hikers, said he had been told by court officials that each of them would have to pay $500,000 in bail, as Shourd had to do. He said the bond was being demanded because, even though Bauer and Fattal have been convicted, their case is open to appeal and a final verdict has not been rendered.

“Basically if they don’t pay their bail, they won’t be freed,” Shafiei said. “I don’t know who arranged this, the court or the president. The judiciary has said that everything is being done according to their procedures.”

Ahmadinejad said Bauer and Fattal will be “free to choose” how they return to the United States. Ahmadinejad’s decision to pardon the men is subject to review by Iran’s clerical authorities.

Bauer, Fattal and Shourd were hiking in the mountains of Iraq’s northern Kurdish region on July 31, 2009, when, according to their families, they strayed across the border by accident. Authorities in Tehran confirmed three days later that the three had been arrested, and an Iranian Arabic-language television network quoted police sources as saying the hikers were “CIA agents.”

Bauer and Shourd were free-lance journalists who were living together in Damascus, Syria, where Shourd also taught English and was studying Arabic, friends and relatives said. Fattal is a friend of Bauer’s who was visiting the Middle East to explore his father’s roots in Iraq. All three graduated from the University of California at Berkeley.

Bauer, an Arabic speaker from Minnesota who graduated from Berkeley in 2007 with a degree in Arabic and peace and conflict studies, was a Middle East correspondent for New America Media and has written for publications including the Nation magazine, the San Francisco Chronicle, the Los Angeles Times and Shourd has written for Brave New Traveler, an online travel magazine. At the time of her arrest, she had identified herself on the magazine’s Web site as a “teacher-activist-writer from California currently based in the Middle East.”

In May 2010, the three Americans’ mothers were allowed to meet with their children in Tehran for the first time since their arrest. The hikers had complained to diplomats about isolation and depression while being held in Evin prison.

But Iran’s intelligence minister, Heidar Moslehi, reiterated his accusations during the visit that the three hikers were on an espionage mission. And he repeated demands for the release of Iranians allegedly abducted by the United States.

Call for elections in Syria

Ahmadinejad parried questions Tuesday about Iran’s ties with the embattled government in Syria, a key ally.

Ahmadinejad called for free elections in Syria and suggested that President Bashar al-Assad implement a reform program, although he was vague about the type of reforms he recommended.

He said Iran’s economy was flourishing, in contrast to the economies of the United States and Western powers that have led efforts to penalize Iran for its uranium-enrichment program. “Those who imposed sanctions on us are now facing economic recession,” he said. “They have created problems for themselves because we have a large economy.”

Ahmadinejad brushed off reports of a serious rift between him and Ayatollah Ali Khamenei, the supreme religious and political authority in the Islamic republic. “Can you find two people in the world who are the same?” he said in response to a question about the split, which surfaced this year when Ahmadinejad attempted to dismiss his intelligence minister, only to be overruled by Khamenei.

The president also shrugged off attacks on a key aide and confidant, Esfandiar Rahim Mashaei, who has been heavily criticized by hard-line conservatives and clerics loyal to Khamenei.

“I do not expect all to like my colleagues,” Ahmadinejad said.

Correspondent Thomas Erdbrink in Tehran and staff writers William Branigin and Joby Warrick in Washington contributed to this report.