Updated

Under Hosni Mubarak's rule, Egypt's authorities took a tough line on Egyptians coming home after waging "jihad" in places like Afghanistan, Chechnya or the Balkans, fearing they would bring back extremist ideology, combat experience and a thirst for regime change. In most cases, they were imprisoned and tortured.

But after Mubarak's overthrow and his replacement by an elected Islamist president, jihad has gained a degree of legitimacy in Egypt, and the country has become a source of fighters heading to the war in Syria.

Egyptian militants are known to have been travelling to Syria to fight alongside Sunni rebels for more than year — but their movements were done quietly. But in recent days, a string of clerics have called for jihad in Syria, with some calling for volunteers to go fight against President Bashar Assad's regime.

On Saturday, Morsi attended a rally by hard-line clerics who have called for jihad and spoke before a cheering crowd at a Cairo stadium, mainly Islamists. Waving a flag of Egypt and the Syrian opposition, he ripped into the Syrian regime, announced Egypt was cutting ties with Damascus and denounced Lebanon's Shiite Hezbollah guerrillas for fighting alongside Assad's forces.

Clerics at the rally urged Morsi to back their calls for jihad to support rebels. Morsi did not address their calls and did not mention jihad. But his appearance was seen as in implicit backing of the clerics' message. It came after a senior presidential aide last week said that while Egypt was not encouraging citizens to travel to Syria to help rebels, they were free to do so and the state would take no action against them.

Khalil el-Anani, an Egyptian expert on Islamist groups, called the move "Morsi's endorsement of jihad in Syria" and warned it was "a strategic mistake that will create a new Afghanistan in the Middle East."

"He is pushing Egypt into a sectarian war in which we have no interest," he said.

The new tone in Egypt risks fueling the flow of Egyptian jihadi fighters to Syria, where the conflict is already increasingly defined by the sectarian divide, with the mostly Sunni rebels fighting a regime rooted in the minority Alawite sect, an off-shoot of Shiite Islam, and backed by Shiite Iran and Hezbollah.

The conflict is also becoming more regional after Hezbollah intervened to help Assad defeat rebels in a strategic western town this month. Since then, hard-liners around the region have hiked calls for Sunnis to join the rebels in the fight. There are already believed to be several thousand foreign fighters among the rebel ranks, largely Islamist extremists some with al-Qaida ties.

The United States last week hardened its own position on Assad's regime, agreeing to provide the rebels with lethal weapons.

Damascus on Sunday lashed out at Morsi for his speech a day earlier, saying he "joins a choir of conspiracy and incitement led by the United States and Israel against Syria."

It accused him of endorsing calls by hardline clerics for people to fight in Syria.

Egypt's powerful military also seemed to distance itself from Morsi speech, in which he pledged that Egypt's government and military are behind the struggle of the Syrian people against Assad.

On Sunday, the state news agency quoted an unidentified military official underlining that "the Egyptian army will not interfere in the internal affairs of other countries. It will not be dragged or be used in any of the regional struggles."

There are no official figures on how many Egyptians have gone to Syria to fight. Security officials monitoring the movement of militants estimate as many as 2,500 have gone, and their numbers are likely to significantly pick up after Hezbollah's intervention.

The officials spoke on condition of anonymity because they were not authorized to speak to the media.

Organizations associated with Egypt's ultraconservative Salafi movement are believed to help organize movements for Egyptians to Syria. Islamist websites have reported that up to several dozen Egyptians have been killed while fighting in Syria the past two years, though the number has not been independently confirmed. The conflict, now in its third year, has killed nearly 93,000 people, according to new figures released by the United Nations.

Under Mubarak's 29-year rule, Egypt was a major Mideast bulwark against religious militancy. Mubarak closely cooperated with the United States and other Western nations in the hunt for extremists wanted in connection with terror attacks and dismantling the financial networks for militant groups. His regime was also notorious for rights abuses and torture against militants and other opponents

In the 1990s, militants who gained combat experience fighting the Russians in Afghanistan staged an anti-government insurgency that took the lives of more than 1,000 people, mostly civilians. Mubarak's security forces crushed the insurgency, and in the years that followed the groups involved renounced violence, though they maintained a hard-line ideology.

The fall of Mubarak in early 2011 and Morsi's election nearly a year ago allowed many of the former militants to come in from the cold.

Morsi and the Muslim Brotherhood, from which he hails, gets key backing from one of the main former Islamic militant groups, Gamaa Islamiya, as well as from several political parties of the Salafi movement.

A senior official at the Interior Ministry, which is in charge of police and internal security, said the names of at least 3,000 militants have in recent months been removed from the wanted list posted at the country's points of entry over the past two years.

Many of the 3,000 have since Morsi taken office returned to Egypt from exile and are now freely participating in the country's Islamist-dominated politics, said the official.

Those who returned home included individuals tried and convicted in connection to the 1981 assassination of President Anwar Sadat, the attempted assassination against Mubarak in Ethiopia in 1995 or militants who have been involved in wars abroad, said the official, who also spoke on condition of anonymity because he was not authorized to speak to the media.

Morsi's turning up the heat on Assad's regime appeared to be a concession to his ultraconservative allies, who have been unhappy with his government's moves to improve ties with Shiite Iran, Assad's main regional backer.

It also strengthens their backing for him ahead of giant anti-Morsi demonstrations planned by his opponents on June 30.

"This is a terrible idea," said Michael W. Hanna, an Egypt expert from the New York-based Century Foundation. "He is refocusing the anger of Egyptians over his policies away toward foreign issues instead of the domestic mess he is presiding over at home."

The security official said there are worries in the security establishment that sanctioning travel to Syria for Egyptians could later embolden jihadi groups to set up their training camps and political parties to create their own militias. Armed militant groups have become increasingly active in lawless parts of the Sinai Peninsula, where there has been a flood of weapons smuggled from Libya.

The change in Egypt's approach has not gone unnoticed in the West.

Last week, Germany's Interior Ministry issued its 2012 report on domestic security in which it noted an increase in the travel to Egypt by suspected Islamic extremists, ostensibly because they wanted to live in Muslim countries or study Arabic but in some specific cases may have been really interested in joining jihadi training camps.

The report doesn't specify where these training camps are located, whether in Egypt or elsewhere in the Middle East, North Africa or South Asia.

___

AP correspondent Robert H. Reid in Berlin contributed to this reports.