Then Cuban Prime Minister Fidel Castro attends manoeuvres during the 19th anniversary of his and his fellow revolutionaries arrival on the yacht Granma, in Havana in this November 1976 file photo. REUTERS/Prensa Latina/File Photo

Fidel Castro, the Cuban revolutionary leader who built a communist state on the doorstep of the United States and for five decades defied U.S. efforts to topple him, died on Friday. He was 90.

A towering figure of the second half of the 20th Century, Castro stuck to his ideology beyond the collapse of Soviet communism and remained widely respected in parts of the world that had struggled against colonial rule.

He had been in poor health since an intestinal ailment nearly killed him in 2006. He formally ceded power to his younger brother Raul Castro two years later.

Wearing a green military uniform, a somber Raul Castro, 85, appeared on state television on Friday night to announce his brother’s death.

“At 10.29 at night, the chief commander of the Cuban revolution, Fidel Castro Ruz, died,” he said, without giving a cause of death.

“Ever onward, to victory,” he said, using the slogan of the Cuban revolution.

Tributes came in from around the world.

Venezuela’s Socialist President Nicolas Maduro said “revolutionaries of the world must follow his legacy,” while Pope Francis said he was grieving and praying for the repose of the professed atheist, whom he met in Cuba last year.

China’s president, Xi Jinping, said “the Chinese people have lost a close comrade and a sincere friend”. U.S. President-Elect Donald Trump said on Twitter: “Fidel Castro is dead!”, without elaborating.

DECADES OF HOSTILITY

Raul Castro, who always glorified his older brother, has nevertheless changed Cuba since taking over by introducing market-style economic reforms and agreeing with the United States in December 2014 to re-establish diplomatic ties and end decades of hostility.

It remains unclear if Trump will continue efforts to normalize relations with Cuba or fulfill a campaign promise to close the U.S. embassy in Havana once again.

Fidel Castro himself offered only lukewarm support for the 2014 deal with Washington, raising questions about whether he approved of ending hostilities with his longtime enemy. Some analysts believed his mere presence kept Raul from moving further and faster, while others saw him as either quietly supportive or increasingly irrelevant.

He did not meet Barack Obama when he visited Havana earlier this year, the first time a U.S. president had stepped foot on Cuban soil since 1928.

Days later, Castro wrote a scathing newspaper column condemning Obama’s “honey-coated” words and reminding Cubans of the many U.S. efforts to overthrow and weaken the Communist government.

The news of Castro’s death spread slowly among Friday night revelers on the streets of Havana. One famous club that was still open when word came in quickly closed.

Some residents reacted with sadness to the news.

“I’m very upset. Whatever you want to say, he is a public figure that the whole world respected and loved,” said Havana student Sariel Valdespino.

But in Miami, where many exiles from Castro’s government live, a large crowd waving Cuban flags cheered, danced and banged on pots and pans.

Castro’s body will be cremated, according to his wishes. Cuba declared nine days of mourning, during which time the ashes will be taken to different parts of the country. A burial ceremony will be held on Dec. 4.

The bearded Fidel Castro took power in a 1959 revolution and ruled Cuba for 49 years with a mix of charisma and iron will, creating a one-party state and becoming a central figure in the Cold War.

He was demonized by the United States and its allies but admired by many leftists around the world, especially socialist revolutionaries in Latin America and Africa.

Nelson Mandela, once freed from prison in 1990, repeatedly thanked Castro for his firm efforts in helping to weaken apartheid.

In April, in a rare public appearance at the Communist Party conference, Fidel Castro shocked party apparatchiks by referring to his own imminent mortality.

“Soon I will be like all the rest. Our turn comes to all of us, but the ideas of the Cuban communists will remain,” he said.

Castro was last seen by ordinary Cubans in photos showing him engaged in conversation with Vietnamese President Tran Dai Quang earlier this month.