• Vice president Nicolas Maduro takes up interim post • Wave of mourning breaks out in streets of Venezuela • Chávez to get state funeral in Caracas

Venezuelans began seven days of painful and public mourning on Tuesday night after the announcement that their president, Hugo Chávez, had died aged 58 after a long battle against cancer.

The country's vice-president, Nicolás Maduro – tipped as a likely successor – broke the news on Tuesday night, prompting a wave of grief in the nation's streets.

"We have just received the most tragic and awful information. At 4.25pm, President Hugo Chávez Frias died," Maduro announced in a televised address, his voice choking. "It's a moment of deep pain," he said.

Chávez died at a military hospital in Caracas, the capital of the country he has ruled since 1999. As soon as the news was announced, supporters gathered at the city's main square, Plaza Bolivar, and began chanting: "Chávez vive, la lucha sigue" – "Chávez lives, the battle continues."

People wearing the red beret the president was known for sang a popular folk song with the words: "Those who die for life cannot be called dead."

As messages of condolence came from many world leaders, perhaps the most significant was from Barack Obama. He said: "At this challenging time of President Hugo Chávez's passing, the United States reaffirms its support for the Venezuelan people and its interest in developing a constructive relationship with the Venezuelan government. As Venezuela begins a new chapter in its history, the US remains committed to policies that promote democratic principles, the rule of law and respect for human rights."

Chávez, the symbol of Latin American socialism, succumbed to a respiratory infection on Tuesday evening, 21 months after he first revealed he had a tumour. He had not been seen in public for three months since emergency surgery in Cuba on 11 December.

He will be given a state funeral in Caracas on Friday, likely to be attended by millions of supporters and leftwing leaders from across the globe who have been inspired by Chávez's doctrine of "Bolivarian 21st-century socialism", grateful for the subsidised energy he provided or simply impressed by his charisma. His death will also trigger a presidential election, to be held within 30 days, to decide who controls the world's greatest untapped reserves of oil.

His designated successor, Maduro, is likely to face Henrique Capriles, the losing opposition candidate in the presidential election held a few months ago in October 2012. Until then, according to the constitution, the interim president should be the head of the national assembly, Diosdado Cabello. However on Tuesday night the Venezuelan foreign minister, Elias Jaua, said Maduro was the interim president. It was not clear whether this would only apply until the official calling of the election and beginning of the campaign, or whether Maduro would remain in charge until the election result was determined.

Robert Menendez, chairman of the US Senate foreign relations committee, called for free and fair elections to replace Chávez. "Hugo Chavez ruled Venezuela with an iron hand and his passing has left a political void that we hope will be filled peacefully and through a constitutional and democratic process, grounded in the Venezuelan constitution and adhering to the Inter-American Democratic Charter."

Replacing one of most colourful figures on the global political landscape will be an immense challenge. Born to a poor family on the plains, Chávez became a tank commander and a devotee of South America's liberator, Simón Bolívar. A failed coup in 1992 propelled him into the limelight but it was his ballot box triumphs that made him an inspiration for the resurgent Latin American left and the most outspoken – and often humorous – critic of the US, the war in Iraq and George Bush, whom he described as a "donkey" and a "devil". Formerly one of the most dynamic political leaders in the world with a globe-trotting schedule and a weekly, unscripted TV broadcast – often hours long – Chávez shocked his countrymen in June 2011 when he revealed that Cuban surgeons had removed a baseball-sized tumour from his pelvic region.

After that, he underwent several rounds of chemotherapy and two more operations in what he described as a "battle for health and for life". His medical records were never made public, prompting widespread speculation about his imminent demise, but he and his supporters insisted he was recovering. Before the presidential election in October 2012, aides claimed he was well enough to complete a full term. During that campaign, Chávez was clearly affected by his illness. But although he made fewer and shorter appearances, he won more votes than in any of his earlier elections battles, prompting him to proclaim victory in a "perfect battle".

Fears about his health escalated after he rushed to Cuba for hyperbaric oxygen treatment on 27 November. Less than a fortnight later, he made a televised address in which he said that doctors had discovered malignant cells that required surgery and urged Venezuelans to vote for Maduro if he was incapacitated.

Since his operation in December, Chávez has been visited by family members and several of his closest political allies, including Fidel and Raul Castro of Cuba, Ecuadorean president Rafael Correa and Bolivian president Evo Morales.

Beyond a set of four photographs released last month that showed a remarkably hearty looking Chávez smiling in a hospital bed and flanked by his daughters, the president has not been seen or heard for three months. This prompted frequent rumours that the president was dead or on life support. The government denied this and said he continued to run the country by writing down his orders.

But officials acknowledged that Chávez suffered multiple complications after his surgery including respiratory infections and bleeding. He had to undergo more chemotherapy and drug treatments and could only breathe through a tracheal tube. He returned from Cuba on 18 February at his own request, said officials. Since then he has been treated at Carlos Arvelo military hospital in Caracas.

Hopes for a recovery dimmed on Monday, when minister of communications, Ernesto Villegas, said the president's condition had declined due to a "new and serious respiratory infection."

Constitutional questions have been raised by his long hospitalisation and absence from public life, which he formerly dominated with dynamic and provocative appearances on his weekly television address, Hello Mr President.

When he failed to attend his scheduled inauguration on 10 January, the opposition asked who is running the country. The ruling party responded with a rally of more than 100,000 supporters, many carrying banners declaring "We are Chávez."