The policy shift deprives Assad of one of his few remaining Sunni Muslim supporters in the Arab world and deepens his international isolation. It was announced in Hamas speeches at Friday prayers in Cairo and a rally in the Gaza Strip.

Hamas went public after nearly a year of equivocating as Assad's army, largely led by fellow members of the president's Alawite sect, has crushed mainly Sunni protesters and rebels.

In a Middle East split along sectarian lines between Shi'ite and Sunni Islam, the public abandonment of Assad casts immediate questions over Hamas's future ties with its principal backer Iran, which has stuck by its ally Assad, as well as with Iran's fellow Shi'ite allies in Lebanon's Hezbollah movement.

"I salute all the nations of the Arab Spring and I salute the heroic people of Syria who are striving for freedom, democracy and reform," Hamas leader Ismail Haniyeh, visiting Egypt from the Gaza Strip, told thousands of Friday worshippers at Cairo's al-Azhar mosque.

"We are marching towards Syria, with millions of martyrs," chanted worshippers at al-Azhar, home to one of the Sunni world's highest seats of learning. "No Hezbollah and no Iran.

"The Syrian revolution is an Arab revolution."

Contemporary political rivalries have exacerbated tensions that date back centuries between Sunnis - the vast majority of Arabs - and Shi'ites, who form substantial Arab populations, notably in Lebanon and Iraq, and who dominate in non-Arab Iran.

Hamas and Hezbollah, confronting Israel on its southwestern and northern borders, have long had a strategic alliance against the Jewish state, despite opposing positions on the sectarian divide. Both have fought wars with Israel in the past six years.

But as the Sunni-Shi'ite split in the Middle East deepens, Hamas appears to have cast its lot with the powerful, Egypt-based Sunni Islamists of the Muslim Brotherhood, whose star has been in the ascendant since the Arab Spring revolts last year.

HAMAS MAKES ITS CHOICE

"This is considered a big step in the direction of cutting ties with Syria," said Hany al-Masri, a Palestinian political commentator. Damascus might now opt to formally expel Hamas's exile headquarters from Syria, he told Reuters.

Banned by deposed Egyptian leader Hosni Mubarak, the Muslim Brotherhood has moved to the centre of public life. It is the ideological parent of Hamas, which was founded 25 years ago among the Palestinians, the majority of whom are Sunni Muslims.

Shi'ite Hezbollah still supports the Assad family, from the minority Alawite sect, an offshoot of Shi'ite Islam, which has maintained authoritarian rule over Syria's Sunni majority for four decades but now may have its back to the wall.

Hamas, however, has been deeply embarrassed among Palestinians by its association with Assad, as the death toll in his crackdown on opponents has risen into the thousands.

In Gaza, senior Hamas member Salah al-Bardaweel addressed thousands of supporters at a rally in Khan Younis refugee camp, sending "a message to the peoples who have not been liberated yet, those free peoples who are still bleeding every day".

"The hearts of the Palestinian people bleed with every drop of blood shed in Syria," Bardaweel said. "No political considerations will make us turn a blind eye to what is happening on the soil of Syria."

ANTI-ISRAEL AXIS WEAKENED

The divorce between Hamas and Damascus had been coming for months. The Palestinian group had angered Assad last year when it refused a request to hold public rallies in Palestinian refugee camps in Syria in support of his government.

Hamas's exile political leader Khaled Meshaal and his associates quietly quit their headquarters in Damascus and have stayed away from Syria for months now, although Hamas tried to deny their absence had anything to do with the revolt.

Haniyeh visited Iran earlier this month on a mission to shore up ties with the power that has provided Hamas with money and weapons to fight Israel. It is not clear what the outcome of his visit has been, though the tone of the latest Hamas comments is hardly compatible with continued warm relations with Tehran.

Rallies in favour of Syria's Sunni majority have been rare in the coastal enclave but on Friday it seemed the Islamist rulers of the territory had decided to break the silence.

"Nations do not get defeated. They do not retreat and they do not get broken. We are on your side and on the side of all free peoples," said Bardaweel.

"God is Greatest," the crowd chanted. "Victory to the people of Syria."

Hamas-Hezbollah relations have been good in the past. But Hamas did not attack Israel when it was fighting Hezbollah in 2006 and Hezbollah did not join in when Israel mounted a major offensive against Hamas in Gaza in the winter of 2008-2009.

Anything that divides Hamas and Hezbollah is likely to be welcomed by Israel, which has been watching warily recent moves by Hamas to reconcile differences with its Palestinian rivals in Fatah, the movement of President Mahmoud Abbas.

There was no immediate Israeli comment on Friday's speeches. (Additional reporting by Tom Perry in Cairo; Writing by Douglas Hamilton; Editing by Alastair Macdonald)