Belisario Betancur, who has died aged 95, began his term in office as Colombian president in 1982 as the most popular leader of his country in half a century, and ended it four years later amid the smoking rubble of the Palace of Justice in Bogotá, a virtual prisoner of the forces of violence.

He had sought peace with the country’s numerous guerrilla movements, as well as an end to corruption and military repression. He even took on the increasingly powerful cocaine barons, backing an extradition treaty with the US that in 1984 cost the life of the justice minister Rodrigo Lara, assassinated apparently on the orders of the drug lord Pablo Escobar.

Internationally, Betancur pursued an interventionist foreign policy that frequently irritated Washington. He took Colombia into the Non-Aligned Movement, helped found the Contadora peace process for Central America, sought a rapprochement with Cuba and even attempted to create a regional debt cartel.

In 1984, peace agreements were signed with the guerrillas of the Farc, the M-19 and the EPL groups: they were to join the civilian political process in exchange for amnesty and a set of reforms which included opening up Colombia’s tightly controlled, two-party system. The Farc – and its civilian partner the Communist party – set up a new, leftist party, the Patriotic Union.

The army and the political right, who had little interest in the settlement proposed by Betancur, used a dirty war to sabotage it, and the peace process broke down. In a desperate attempt to get back into the game, in November 1985 the M-19 seized the Palace of Justice building in central Bogotá.

Their 300 hostages included most of the supreme court and members of the council of state. Betancur refused to negotiate and the army assaulted the building with tanks. More than 100 people died – the exact figure was never determined – including all but one of the judges. Many of the hostages were killed by soldiers, including some who were apparently mistaken for guerrillas and executed, and others who, it was later discovered, were “disappeared” – taken from the building and tortured to death.

Five days after the end of the siege the nation’s trauma deepened when the Nevado del Ruiz volcano erupted, burying most of the town of Armero in a mudslide. The Betancur presidency was buried just as effectively: the president had exhausted his political capital and the armed forces had re-established – without the need for a coup – their veto power over the country’s political life.

Government employees being led by soldiers and police out of the Palace of Justice in Bogotá in 1985 after an army assault on the building set free more than 100 hostages held by the M-19 guerrilla group. Photograph: Carlos Gonzalez/AP

Unlike the majority of Colombian presidents, Betancur was not the scion of a wealthy political dynasty. The son of Ana Otilia Cuartas, a shop assistant, and Rosendo Betancur, a labourer, he was born into a dirt-poor family in Amagá, in the province of Antioquia, and saw 16 of his 20 brothers and sisters die in childhood. As a student at the Universidad Pontífica Boliviariana in Medellín, he spent his first two years sleeping on park benches for lack of money.

Nonetheless, his talent as a politician was recognised early, and, even before graduating as a lawyer, he was elected to parliament. In those days, party affiliation – Liberal or Conservative – depended almost exclusively on family tradition, and Belisario’s family were diehard Conservatives.

In 1950 the Conservative president of the day, Laureano Gómez, appointed the young congressman to the assembly, charged with drawing up a new constitution. But Gómez was eventually overthrown by the populist dictator General Gustavo Rojas Pinilla, and Betancur saw the inside of a jail cell on several occasions during the 1953-57 dictatorship.

Three times an unsuccessful candidate for the presidency – in 1962, 1970 and 1978 – he finally entered the Casa de Nariño, Colombia’s presidential palace, in 1982, thanks to a split in the Liberal vote. As the presidential candidate in 1978, Betancur said the country’s problems exceeded the bounds of party politics, and that now was not the time to be constructing a “Liberal republic” or a “Conservative republic”. This noble, and perhaps naive, desire for consensus did not survive his presidency, at least among the political class.

After leaving office, Betancur wrote books on politics, economics and education, and journalism for several Colombian newspapers.

His first wife, Rosa Helena Alvarez, whom he married in 1945, died in 1998. He married again, to Dalita Navarro. She, and the son, Diego, and two daughters, Beatriz and María Clara, of his first marriage survive him.

• Belisario Betancur Cuartas, lawyer, politician and journalist, born 4 February 1923; died 7 December 2018