Venezuelan President Hugo Chavez has died at 58 after battling cancer for nearly two years and serving in office since 1999.

The socialist leader began his political ascent as a lieutenant colonel in the Venezuelan army on Feb. 4, 1992, when he led a failed coup against then-President Carlos Andres Perez.

Along with several other military officers, Chavez had hoped to bring about a socialist revolution in Venezuela and end what he viewed as the corrupt politics of the Perez administration that left working class Venezuelans without a living wage or social safety net.

Chavez and his armed followers surrendered in Caracas after failing to capture Perez and losing communication with other rebel army units in other parts of the country.

Soon after his arrest, Chavez delivered a televised address in which he announced the coup’s failure and asked all rebel soldiers to stand down.

“Comrades, unfortunately, for now, our objectives in the capital were not achieved,” Chavez said, wearing a red beret and gray army fatigues.

“That is to say, we here in Caracas have not been able to seize power. You have all done well out there, but now is the time to avoid further bloodshed and reflect. New possibilities will arise again and the country will definitely be able to move toward a better future.”

That moment propelled Chavez into the national spotlight, and his popularity continued to grow among poor and working class Venezuelans in the following years.

Chavez spent two years in prison until he was pardoned and released by the next president, Rafael Caldera, who was sympathetic to his cause.

Perez was impeached and removed from office in 1993 after being found guilty of embezzling approximately $17 million in public funds.

Chavez spent the next few years building political support for his socialist cause. He also traveled throughout Latin America to meet with leftist leaders like Cuba’s Fidel Castro, whom he came to view as a mentor.

After debating the merits of armed revolution versus participation in the democratic process, Chavez decided to establish a political party, the Fifth Republic Movement, and launch a bid for the presidency in the 1998 elections.

Chavez’s support among the poor and the working class proved decisive, garnering him 57 percent of the vote, with primary opponent Henrique Salas Romer, a former governor and Yale-educated economist, receiving just under 40 percent.

On Feb. 2, 1999, Chavez stepped into office, claiming that his power was bestowed upon him from the ballot box, rather than from the end of an assault rifle.

Despite his socialist ideology, Chavez began his first term with relatively moderate economic policies, keeping in place many of the country’s capitalistic institutions and deferring to global organizations like the International Monetary Fund for economic advice.

At the same time, he began to establish sweeping social programs aimed at alleviating economic stresses on poor and working class Venezuelans through subsidies for food, health care and education.

Determined to turn a new page in Venezuela’s political history, Chavez held a referendum on reforming the constitution in 1999, which received overwhelming support at the polls.

In December of that year, Venezuelans voted to adopt a new constitution that espoused a new political philosophy reflective of Chavez’s socialist vision, and new elections were scheduled for July 2000 to usher in a new era for the government and the country.

Chavez was re-elected by a wide margin, and in the process, many of his political opponents were purged from the government.

In 2002, the opposition struck back, organizing a paralyzing oil workers strike in an attempt to force Chavez to step down.

Amid the unrest, a group of military officers opposed to Chavez’s socialist vision led a coup and captured the president. Chavez, however, was released after nearly two days in captivity, following an outpouring of popular support and the refusal of key sectors of the military to accept his removal from office.

Over the years, Chavez continued to expand social welfare programs, increased government control over major industries and tightened his hold on power, using state media to ostracize the opposition and push forward his policies.

Chavez was re-elected in 2006, and in his second term under the new constitution, he held a referendum that eliminated presidential term limits among other amendments.

In October’s elections, Chavez faced the greatest electoral challenge to his presidency yet from opponent Henrique Capriles, though he still won by a decisive margin.

Domestically, Chavez’s legacy is a mixed one. While access to food, health care and education has increased and endeared him to the poor and working class, the economy has stagnated under his leadership due to an overdependence on the country’s nationalized oil industry.

Crime rates have also skyrocketed since he first took office in 1999, a reflection of the dysfunction and corruption of the criminal justice system under the socialist "Bolivarian" party.

Internationally, Chavez will be remembered as an antagonist of the U.S. and many of its allies.

While his country depended on the U.S. as the primary market for its oil exports, Chavez often criticized its foreign and economic policies and sought to limit its influence in Latin America.

Chavez was keen on building strong ties with other leftist leaders in the region to achieve this goal and realize his vision for a more economically integrated Latin America that could dictate its own trade relations with the world’s major economic blocs.

The region seems to be moving ever closer in that direction with increasing support from even moderate leaders like Brazil’s President Dilma Rouseff.

Chavez was pivotal in laying down the foundations for a more unified Latin America, and in this respect, his vision will continue to manifest itself beyond his life.

His death comes several months after he was re-elected to another six-year term last October. Under the Venezuelan constitution, new elections must be held within 30 days.

In December, Chavez designated Vice President Nicolas Maduro as his political heir. Maduro is expected to run for president as the Socialist party candidate, while the opposition will most likely field Miranda state governor Henrique Capriles Radonski, who lost to Chavez in October.