Venezuela declared a week of mourning on Wednesday after the death of its president, Hugo Chavez, who led the country for more than 14 years.

The 58-year-old socialist leader, who had won re-election to a third presidential term on Oct. 7, died on  Tuesday after losing a long battle against cancer that was first detected in his pelvis. He had not been seen or heard in public since he underwent his fourth cancer surgery in Havana on Dec. 11.

Chavez's body will be transferred from a hospital to a military academy on Wednesday, with a state funeral scheduled for Friday, the government announced.

Hours after Chavez's death, Foreign Minister Elias Jaua announced that Vice President Nicolas Maduro, whom Chavez named as his successor, will lead the country until new elections, which must be held within 30 days.

Maduro, a 50-year-old former bus driver and union leader, is expected to be the government's candidate at a new presidential election that is likely to pit him against opposition leader and state governor Henrique Capriles.

In Caracas, Venezuela's capital, hundreds of grief-stricken supporters of the late-president gathered at Plaza Bolivar and outside the military hospital where Chavez was being treated, the Telegraph reported.

Within minutes of the announcement of Chavez’s death, Venezuela's national flag was lowered to half mast in Caracas, the report said.

Patricia Villegas, a Venezuelan journalist who was outside the military hospital, told the Telegraph: “There were tears, [and] people looked to the sky and gave thanks for the social changes that had been brought about.”

Chavez’s self-styled socialist government used billions of dollars from Venezuela’s oil refineries to support food subsidies and state-funded social programs, but it has had to contend with a housing crisis, power shortages, an alarming surge in crime, inflation and a weakening economy.

The anti-imperialist and often virulently anti-American leader had aligned his country with such U.S. adversaries as Cuba, Russia, Iran and Belarus.