CAIRO (AP) — One of Egypt's ruling generals took great pains this week to reassure his American audience: the military-led caretaker government has no intention of mending ties with Iran, a longtime foe and regional rival.
But once an elected government takes over from Egypt's interim rulers in coming months, it would have to be responsive to public opinion, Maj. Gen. Mohammed al-Assar said in a speech to a think tank in Washington, suggesting that a different course is then possible.
Iran has been strongly courting Egypt since the February fall of Hosni Mubarak, seeking to break its isolation and extend its influence in the Middle East. The prospect has alarmed Egypt's allies — particularly Saudi Arabia and the Arab countries of the Gulf, as well as Israel, all of which fear increasing Iranian power in the Middle East.
With its own suspicions of Iran and wary of alienating its allies, Egypt is unlikely to run into an embrace with Iran. But how much it does improve ties will be a major indicator of how far its future government will take a more independent foreign policy after decades under Mubarak, who stuck closely to the United States' line in the region.
"What we might be witnessing in the next few months is a struggle within Egypt to define and redefine Egyptian foreign policy," said Fawaz Gerges, head of the Middle East Center at the London School of Economics.
There is strong popular support in Egypt for a foreign policy that does not so strongly mirror Washington's, which proponents argue will help restore the country's clout as a regional leader. For most Egyptians, the top priority is to back off from the close cooperation that the Mubarak regime had with Israel on economic and security issues.
But it could also mean an easing of Mubarak's staunchly anti-Iran stance. One of the leading contenders for the Egyptian presidency, ex-Arab League chief Amr Moussa, argues that Egypt would gain from peaceful or less tense relations with Iran.
Any warming would mark a shift in the political map of the region, which has sharply split between Iran's sphere of influence, including Syria and the Islamic militias of Hezbollah in Lebanon and Hamas in Gaza, and a U.S.-backed camp led by Saudi Arabia, Gulf nations and Mubarak's Egypt.
As recently as 2009, Mubarak's then-intelligence chief, Omar Suleiman, told the U.S. that Iran — with its suspected nuclear weapons program and funding of anti-Western militants — posed a threat to the entire region.
Just two weeks after Mubarak's fall, Iran tested the new Egypt, asking to send two warships through the Egyptian-controlled Suez Canal. Egypt granted the request, a first since 1979, saying it was bound by canal rules of free passage.
A month later, Egypt's new foreign minister, Nabil Elaraby, declared that "Iran is not an enemy" and that Egypt would seek to open a new page with every country in the world, including Iran.
The conciliatory message by Elaraby — who has since moved to the Arab League chief spot — came just as the Cold War between predominantly Sunni Muslim Saudi Arabia and mainly Shiite Iran was deepening: In March, Saudi troops helped put down a Shiite-led uprising in Sunni-ruled Bahrain that Gulf leaders saw as a stalking horse for Iran.
Apparently startled by the signals from Egypt, Saudi Arabia pledged $4 billion for Egyptian economic recovery. In July, Egypt changed course, saying relations with Iran won't come at the expense of security of the Gulf countries.
That same pressure will certainly remain on Egypt's next, elected government. And Egypt has its own suspicions about Iran's policies, particularly its support of Islamic militants around the region.
Gerges expects Egypt will try to seek a middle ground.
"This new thinking (in Egypt) revolves around Iran not being a threat to regional security," he said. "Iran is an integral part of the region and should be engaged politically, as opposed to a policy of confrontation."
Iran seems to be the more eager side in the courtship.
"As soon as I receive an invitation from Egyptian officials I will go immediately and with pride to Egypt," Iranian President Mahmoud Ahmadinejad was quoted as telling a 45-member Egyptian delegation visiting Tehran in June.
Relations between Egypt and Iran broke down after Tehran's Islamic Revolution of 1979 and the signing of the Israeli-Egyptian peace treaty. Contacts have been channeled through interest sections, a low-level form of diplomatic representation.
In May, Egypt expelled a low-level Iranian diplomat on suspicion he tried to set up spy rings in Egypt and the Gulf countries.
Yet in a sign of a relationship in flux, the same plane that flew home the expelled Iranian diplomat also carried the Egyptian delegation of legislators, ex-diplomats and uprising activists to Tehran for their ice-breaking trip.
Former Egyptian diplomat Ahmed Ghamrawy, who led the group, argued that closer ties would help stabilize the Middle East. "Why is the West troubled by Iranian relations with Egypt, even though the Gulf countries all have ambassadors in Iran?" he said.
Still, the trip also highlighted the ambivalence. Mustafa el-Naggar, an Egyptian uprising activist in the delegation, told an Egyptian TV interviewer that when his Iranian hosts claimed the popular uprisings sweeping the Arab world were part of an "Islamic awakening," he told them that the anti-Mubarak revolt was "not a religious revolution, but a human evolution."
Israel is watching the prospect of an improvement in Egypt-Iran ties with trepidation.
Israel's military intelligence chief, Maj. Gen. Aviv Kochavi, told Israeli lawmakers this month that Iran has begun funding Egypt's Muslim Brotherhood ahead of parliament elections in the fall. He did not provide evidence, and the Brotherhood denied the claim.
"We are keeping our fingers crossed for Saudi Arabia and Egypt, hoping that Iran will not succeed in its ambitions to penetrate into other areas of the Middle East," said Eli Shaked, a former Israeli ambassador to Egypt.
AP correspondent Sarah El Deeb contributed to this report.