Fidel Castro, the father of communist Cuba who led the country for nearly half a century, died Friday night at the age of 90, President Raul Castro announced on state TV.

The former president was expected to be cremated, as he wished, on Saturday, his brother said in the brief televised message, which he concluded with the revolutionary rallying cry, "onward toward victory, always."

The Cuban government announced nine days of national mourning beginning Saturday and culminating with a burial ceremony Dec. 4. In the meantime, a mass gathering will be held in the capital Tuesday. The following day, his ashes will embark on a four-day tour of the country retracing the "Caravan of Liberty" he led after ousting his predecessor in 1959.

Celebrations erupted on the streets of Cuban-American neighborhoods in Miami and remembrances from world leaders poured in when word spread that the divisive, iconic figure had passed away.

Castro retreated from the public eye in 2006 following emergency surgery for intestinal bleeding. His health problems forced him to temporarily hand power to his younger brother, who permanently took his place as president in 2008.

Castro's death follows a historic thawing of relations between Cuba and the United States with the announcement in mid-December that the countries planned to restore diplomatic and economic ties.

Six weeks after that announcement, Castro made his first comments about the deal, writing that he backs the negotiations even though he distrusts American politics.

"I don't trust the policy of the United States, nor have I exchanged a word with them, but this does not mean I reject a pacific solution to the conflicts," he wrote in a letter to a student federation read at the University of Havana.

In a statement released Saturday, President Obama called for continued partnership between Cuba and the United States.

"Today, we offer condolences to Fidel Castro's family, and our thoughts and prayers are with the Cuban people," Obama said in the statement. "In the days ahead, they will recall the past and also look to the future. As they do, the Cuban people must know that they have a friend and partner in the United States of America."

"We will always defend cooperation and friendship with all the people of the world, including with our political adversaries," he wrote.

President-elect Donald Trump, meanwhile, assailed Castro as a "brutal dictator" in a statement Saturday.

"Today, the world marks the passing of a brutal dictator who oppressed his own people for nearly six decades," Trump said in the statement. "Fidel Castro’s legacy is one of firing squads, theft, unimaginable suffering, poverty and the denial of fundamental human rights."

Trump's statement goes on to say that his administration will work toward ensuring "prosperity" and "liberty" for the Cuban people.

"Though the tragedies, deaths and pain caused by Fidel Castro cannot be erased, our administration will do all it can to ensure the Cuban people can finally begin their journey toward prosperity and liberty," the statement read.

Since relinquishing power, Castro's health had been the topic of intense speculation. On several occasions, media reported inaccurately that he was near death or had died. Once in 2012, Castro replied to the rumors himself in an article published on Cuba Debate, a state-run website, in which he boasted that he was not only alive, but didn't "even remember what a headache is."

Castro had defied death many times before, both as the revolutionary who led an armed uprising against dictator Fulgencio Batista, and as Batista's communist successor who inspired a number of U.S.-backed assassination plots. Nine U.S. presidents came and went during Castro's rule, which, like him, proved resilient, outlasting most other communist governments around the world.

For 49 years Castro ran Cuba, transforming what was once an American playground with striking social inequalities into a poor, isolated country with a notorious record on human rights. To some, he was a hero. Through a rigid system of socialized medicine, education and cultural facilities, Castro's government elevated Cuba's most impoverished citizens and reduced the sort of racial inequalities prevalent throughout the Americas. For challenging and insulting U.S. policies and presidents, he won the devotion of like-minded leaders, including the late Venezuelan president Hugo Chavez. In a 2004 speech slamming the U.S. war on terrorism, for example, Castro accused President George W. Bush of hypocrisy and fraud, while in 2011 he penned an op-ed in the Cuban press calling President Barack Obama "stupid."

His own critics, however, were not tolerated. To those who challenged his revolutionary vision or lived outside of the rigid framework he established on the island—which for years quarantined its HIV-positive citizens and jailed everyone from dissidents to homosexuals—he was a brutal dictator.

U.S. politicians were among the most harsh Castro critics. Florida Senator Marco Rubio condemned Castro in a statement Saturday, writing in part: "One thing is clear, history will not absolve Fidel Castro; it will remember him as an evil, murderous dictator who inflicted misery and suffering on his own people."

Castro's human rights abuses and economic policies prompted throngs of Cubans to flee, many risking their lives to do so. One of the largest mass exoduses came in 1980 when Castro opened the exits to more than a hundred thousand citizens, including prisoners and mental patients who were loaded on boats bound for Florida. In a speech to supporters, Castro happily bid them farewell and mocked the United States for "doing an excellent sanitation job for us."

In his final years, however, Castro appeared to be taking a more critical look at the policies he had enacted, calling his government's treatment of gays, for example, an "injustice," and saying in 2010 that "the Cuban model [of communism] doesn't even work for us anymore."

Indeed, Raul Castro has loosened both travel restrictions and the government's grip on the economy since taking power in 2008, allowing citizens to open some small businesses and legally buy everything from computers and cell phones to foreign cars, however exorbitantly taxed they may be.

The agreement to normalize relations between Cuba and the United States came as prisoners in both countries were freed, among them U.S. subcontractor Alan Gross, sentenced in 2009 to 15 years in prison for trying to set up internet access for the Jewish community in Cuba. But the U.S. trade embargo in place for more than 50 years remained in place. Only Congress can lift it.

Raul Castro, currently 85, has said that he will not seek reelection at the end of his second term in 2018, which will leave the leadership of the country open to someone other than an original Cuban revolutionary for the first time since the overthrow of Batista.

Fidel Alejandro Castro Ruz, the son of a wealthy Spanish-born landowner and his cook, was born Aug. 13, 1926. His upbringing, which exposed him to both the privilege and poverty of his nation, laid the groundwork for his revolutionary path later on.

His political views were further shaped at the University of Havana, where he studied law. After graduating, he delved deeper into revolutionary politics and ultimately organized the rebellion that would overthrow Batista. Joined by his brother Raul, and the legendary guerrilla fighter Ernesto "Che" Guevarra, Castro succeeded in ousting his predecessor in 1959 after two failed attempts, one of which landed him in prison.

While the United States quickly recognized Castro's new government, it cut off diplomatic ties as the country's communist policies – such as the nationalization of U.S. properties in Cuba – became clear.

The next few years were marked by increasingly desperate attempts on the part of the U.S. to remove Castro from power. The Bay of Pigs invasion, a botched mission that sent U.S.-trained Cuban exiles back home to take down Castro, became one of the biggest embarrassments of John F. Kennedy's presidency, and emboldened Castro and his supporters.

Months later, Castro green-lighted the construction of Soviet nuclear missile sites on the island, well within range of U.S. targets. When Kennedy caught wind of the plans, a 13-day standoff ensued, with Kennedy ultimately convincing the Soviets to back down in exchange for the removal of U.S. missiles from Turkey. The so-called Cuban Missile Crisis was a defining moment for both Kennedy and Castro and further embittered relations between the two countries.

Castro's prolific writing and famously long-winded speeches regularly featured tirades against the U.S. and insistence that Cuba would never change course. "Socialism or death! Fatherland or death!" was the motto.

Though he demonstrated, throughout his life, his willingness to die for his vision and values, he survived one of the longest and most controversial political careers of the 20th century, only stepping down as the result of his declining health.

Little is known about how Castro spent his final years. The topic of both his health and personal life have been closely guarded secrets, with Castro revealing only as much as he wished. It is unclear, for example, just how many children he fathered. Asked in an interview for Vanity Fair in 1993, Castro replied, "it's almost a tribe."

What is known is this: He was married twice, first to Mirt Diaz-Balart, whom he divorced in 1955 after having one child, and later to Dalia Soto del Valle, with whom he had five sons. Others have been cited as mistresses and children, including Alina Fernandez, a Cuban exile who published a memoir about growing up as Castro's daughter in 1960s Cuba.

After leaving the presidency, Castro wrote a series of his own personal reflections, though his focused mainly on past and current events. In his final post, published in September 2013, Castro expressed relief that the U.S. appeared to be backing away from plans to intervene militarily in Syria's civil war—a move, he said, that could prevent "global catastrophe."