DAMASCUS, Dec 8 (Reuters) - Syrian rebels seized the capital Damascus unopposed on Sunday after a lightning advance that sent President Bashar al-Assad fleeing to Russia after a 13-year civil war and six decades of his family's autocratic rule.

In one of the biggest turning points for the Middle East in generations, the fall of Assad's government wiped out a bastion from which Iran and Russia exercised influence across the Arab world. Moscow gave asylum to Assad and his family, Mikhail Ulyanov, Russia's ambassador to international organizations in Vienna, said on his Telegram channel.

His sudden overthrow, at the hands of a revolt partly backed by Turkey and with roots in jihadist Sunni Islam, limits Iran's ability to spread weapons to its allies and could cost Russia its Mediterranean naval base. It could allow millions of refugees scattered for more than a decade in camps across Turkey, Lebanon and Jordan to finally return home.

For Syrians, it brought a sudden unexpected end to a war in deep freeze for years, with hundreds of thousands dead, cities pounded to dust and an economy hollowed by global sanctions.

"How many people were displaced across the world? How many people lived in tents? How many drowned in the seas?" the top rebel commander, Abu Mohammed al-Golani, told a huge crowd at the medieval Umayyad Mosque in central Damascus, referring to refugees who died trying to reach Europe.

"A new history, my brothers, is being written in the entire region after this great victory," he said, adding that with hard work Syria would be "a beacon for the Islamic nation."

The Assad police state - known since his father seized power in the 1960s as one of the harshest in the Middle East with hundreds of thousands of political prisoners - melted away overnight.

Bewildered and elated inmates poured out of jails after rebels blasted open their cells. Reunited families wept in joy. Newly freed prisoners were filmed at dawn running through the Damascus streets holding up the fingers of both hands to show how many years they had been in prison.

"We toppled the regime!" a voice shouted as one prisoner yelled and skipped with delight.

The White Helmets rescue organization said it had dispatched five emergency teams to the notorious Sedhaya prison to search for hidden underground cells believed to hold detainees.

Photo from Reuters