Fighting for his political life, President Hugo Chavez overcame a vigorous challenge by Henrique Capriles in Sunday’s presidential election, receiving another six-year term that will give the populist firebrand the opportunity to complete the consolidation of what he calls 21st century socialism in one of the world’s great oil powers.

The victory, announced by the National Electoral Council late Sunday, gave Chavez the win with 54.4 percent of the vote, while Capriles took 44.9 percent. In winning his fourth presidential election since 1998, Chavez captured just over 7.4 million votes to 6.1 million for his adversary, turning back what had been a determined battle by Capriles, a 40-year-old former governor.

“I congratulate the opposition and the directors of the opposition, because they recognize the victory of the people,” Chavez told throngs of supporters gathered outside the presidential palace. “That’s why I send them this salute and put out my arms to them, because we are all brothers in the fatherland of Bolivar.”

Half an hour later, Capriles conceded at his campaign headquarters. But he signaled that the support of millions of Venezuelans showed that his proposals had struck a chord. And he asked that Chavez, who often mocks his foes as oligarchs and lackeys of U.S. imperialism, take the opposition’s needs into account.

“I’m convinced that this country can be better,” Capriles said in a halting, emotional speech. “Being a good president means working for all Venezuelans.”

Chavez’s victory touched off wild celebrations in the capital, where crowds of the president’s red-shirted supporters — the “Chavistas” from the poorest barrios who have been the backbone of his movement — set off fireworks and blew horns.

“You can’t do better than this president,” said Miguel Guevara, 77, who sells books in the streets and voted in a poor barrio whose support helped bring Chavez to power. “The only one who has helped the country is named Hugo Chavez.”

The president of the electoral council, Tibisay Lucena, said more than 80 percent of the country’s nearly 19 million registered voters participated in the election.

“To the participants who didn’t get victory, consider yourselves victors, too,” she said in making her announcement to loud cheers among Chavez’s supporters. “To participate in an electoral process like this one, in democracy, is a victory for the whole people of Venezuela. The entire country has won.”

Chavez still faces a host of challenges that were highlighted by Capriles’s focused, well-organized campaign, in which the youthful lawyer — known as “Skinny” to his followers — hammered the government daily for the country’s decaying infrastructure, increasing dependence on oil exports and inability to control one of the world’s highest homicide rates.

A largely forgotten topic in recent months that may again become a major issue is the tumor in Chavez’s pelvic region that he has said was removed this year. Although he announced that he was cured after months of chemotherapy and radiation therapy, details about his health remain a state secret.

The president was clearly slowed by the cancer during the campaign, which served to highlight Capriles’s vigor. The man known as El Comandante to his followers appeared bloated, had to walk gingerly and could no longer speak to crowds for hours at a time, as had been his custom.

Carlos Romero, a political analyst here who has closely tracked the election, said that despite Chavez’s victory, his economic model of state interventions has failed. That failure, Romero said, coupled with Chavez’s questionable health, meant that this is likely to be the last major win for the president.

“What I am clear about is that this is the last victory for Chavez,” said Romero, who had predicted Chavez’s victory in the election. “The cycle is closing.”

After coming to prominence in the 1990s after a failed attempt to seize power, Chavez, a former army paratrooper, won a series of elections: referendums that led to a new constitution and ended term limits and a vote that turned back a recall referendum in 2004.

But Chavez lost a 2007 referendum that would have given him a raft of new powers, and the opposition won more votes in elections staged in 2010 for lawmakers in the country’s National Assembly.

Venezuelans flooded polling stations Sunday, each side determined to choose between two starkly different candidates: one who offers a powerful state that nationalizes companies and spends freely on social programs with petrodollars and another who offered a more business-friendly government that would rebuild tattered relations with the United States.

“It’s not only about a president but about a whole political system — socialism or democratic, so it’s very important for us,” said David Fermin, 44, an economist who voted in a leafy upper-class neighborhood that was supportive of Capriles.

The president’s campaign, though, was disciplined and loyal, and well before dawn bugles sounded in the poor barrios that have come out for him in force many times. That got voters to the polls, where lines started to form before 5 a.m. for openings an hour later.

For those most fervent of followers, Chavez has been a leader like no other — he has spent heavily, using billions of dollars under his control to start small-scale social programs that provide everything from cheap food to basic medical care in the tumbledown barrios that carpet the hills of this and other cities.

Lilian Gonzalez, 60, who takes care of children, praised Chavez and said that the run-up to the election had been anguishing for her because she feared that the president would be defeated and that the country would “go back to the past.”

“Here, the poorest people now have meals three times a day,” she said, explaining one reason why she supported Chavez.

Chavez has long used his oratorical gifts and the oil money he controls through his office to cast himself as a father figure to the poor, creating a near-religious connection with his followers, one that has never been easy for the opposition to break.

In the campaign, he heaped scorn on Capriles, calling him everything from a “fascist” to a “mediocre bootlicker.”

“Who’s going to debate with you?” Chavez said in one recent speech, after Capriles challenged him to a debate. “Learn how to talk first.”

He argued that Capriles would represent the interests of the United States, not the poor, and that his government would slash popular social programs, a claim that Capriles had to repeatedly deny.

The attacks had an impact.

Javier Alejandro Piñango, 33, a delivery driver, said he didn’t trust Capriles, arguing that the contender had tried to fashion himself as a populist like Chavez.

“The other candidate has no proposal, he has no spark,” Piñango said as he cast his ballot in a poor neighborhood. “That is what I like about El Comandante and what he has done. He has changed things and has also awakened us. And the country is better.”

Capriles, noting the government’s heavy spending on the campaign and its overwhelming control of the airwaves, compared himself frequently to David and Chavez to Goliath. “David won over Goliath because he was not afraid,” Capriles told reporters recently. “The Venezuelan people are not afraid.”

But the argument did not sway Tailde Salazar, 45, a teacher who had been trained through a government program in the slum where she lives.

“Our hope, our leftist movement is in place with this revolution,” she said.