Cubans gathered at Havana’s Revolution Square to commemorate Fidel Castro, the communist guerrilla leader who led a revolution in 1959 and ruled the Caribbean island for half a century.

Monday’s ceremony came as US president-elect Donald Trump threatened to scrap a historic deal between Cuba and the United States towards a normalisation of relations, which was initiated by President Barack Obama two years ago.

The Cuban government invited mourners to Revolution Square for a two-day ceremony starting on Monday. An urn holding the late leader’s ashes is on display.

People lined up at 5am outside the Jose Marti monument to pay tribute to Castro [Lucia Newman]

Al Jazeera’s Lucia Newman, reporting from Havana, said huge lines of people had already formed.

“They are being asked to go on and sign a pledge confirming their allegiance to his ideals, to his revolution. It is clearly a way of saying that he will remain alive even after he is physically gone.”

The ceremony in the capital ends on Tuesday night when foreign leaders are expected to pay their respects to a man who dedicated his life to fighting capitalist and colonial oppression, aligned his country with the Soviet Union, and outlasted nine US presidents who had sought to oust or undermine him.

A cortege will carry Castro’s remains east across the 1,200km-long, eyebrow-shaped island to Santiago de Cuba. His cremated ashes will be laid to rest in the birthplace of the revolution when the mourning period ends on December 4.

Along the way, admirers will mourn a man many here saw as a visionary who stood up to US domination of Latin America, brought healthcare and education to the poor, and inspired socialist movements across the world.

READ MORE: Cuban leader Fidel Castro’s mixed legacy

But critics, including exiles concentrated largely in Miami, have celebrated Castro’s death, saying he was a tyrant who jailed his opponents, banned opposition parties, and wrecked Cuba’s economy with a failed socialist experiment.

Castro died on Friday at the age of 90, a decade after stepping down because of poor health and ceding power to his brother, Raul Castro.

Castro was cremated on Saturday and a nine-day period of mourning was declared.

Meanwhile, Trump on Monday threatened to end the US thaw with Cuba unless Havana makes concessions on human rights and opening up its economy.

“If Cuba is unwilling to make a better deal for the Cuban people, the Cuban/American people and the US as a whole, I will terminate deal,” Trump said on Twitter.

The incoming president’s hard line came just a day after his senior advisers promised to strike a “better deal” with the communist-ruled island after Castro’s death, without stating how this might affect the historic rapprochement begun under Obama.

While prominent Republicans have blasted Castro as a murderous tyrant since his death, no one close to Trump had directly threatened to end the political opening announced in 2014 by Obama and his Cuban counterpart Raul Castro – until Trump’s Monday morning tweet.

His team has said the outgoing Democratic administration made too many concessions to Havana – notably by easing the 1962 US economic embargo – without receiving enough concessions in areas such as human rights, democracy, and the move towards a free-market economy.