TUNIS, Tunisia — The funeral of an assassinated leftist politician drew hundreds of thousands of mourners chanting anti-government slogans to the Tunisian capital, Tunis, on Friday — as well as gangs of armed young people who smashed cars and clashed with police outside the cemetery.

Hours later, the prime minister insisted he’d try to form a new government despite his party’s opposition, threatening to resign if his proposal wasn’t accepted.

The events added to the growing turmoil in Tunisia, where the transition from dictatorship to democracy has been shaken by religious divides, political wrangling and economic struggles. It’s been a perilous stretch for a country many hoped would be a model for other post-revolutionary Arab states.

People from across the nation flowed into Tunis to lay to rest Chokri Belaid, 48, a lawyer and top figure in the Popular Front alliance who was shot dead Wednesday. Thousands helped carry the coffin of the so-called defender of the poor from his parents’ home to the Jellaz Cemetery.

The turnout at the funeral was boosted due to a general strike called by Tunisia’s most powerful labor union in honor of Belaid.

Hamma Hammami of the Tunisian Workers Party gave a eulogy as Belaid’s friends and relatives wept. “Sleep well Chokri. We will continue the fight,” the leftist leader promised as the acrid odor of tear gas from the clashes near the cemetery invaded the air.

Tunisians overthrew long-ruling dictator Zine El Abidine Ben Ali in January 2011, kicking off the Arab Spring revolutions. In the two years since, a moderate Islamist party, Ennahda, won elections and has governed in a coalition with two secular parties.

But the ruling coalition’s failure to stem the country’s economic crisis and stop the often-violent rise of hard-line Salafi Muslims has drawn criticism, especially from staunch secularists such as Belaid.

He had also accused Ennahda of backing some of the political violence through its own goon squads.

Belaid was shot dead while outside his home by an unidentified assailant. Hours after his killing Wednesday, Prime Minister Hamadi Jebali said he would form a new, technocratic government to guide the country to elections — but Ennahda, his own party, rejected that idea soon afterward.

Late Friday, Jebali renewed his proposal for a new government, which would be a key concession to the country’s opposition.

“I am convinced this is the best solution for the current situation in Tunisia,” Jebali said, offering to resign if the elected assembly did not accept his new proposed Cabinet.

As Belaid was being buried, the black smoke of burning cars mingled with clouds of white tear gas as masked and hooded young people brandishing machetes and clubs threw rocks at riot police nearby.