This article was updated on 25 August 2016 after the peace deal signed between the Colombian government and the FARC.

It’s Latin America’s longest-running uprising and has left thousands dead, displaced millions, and had an enormous economic cost. But Colombia’s internal conflict – which has pitted left-wing rebels against right-wing paramilitaries and dragged on for over 50 years – is coming to an end.

After drawn-out negotiations, the Colombian government signed a historic peace deal with the FARC rebel forces in Cuba. “The Colombian government and the FARC have reached a final, full and definitive accord,” both parties said in a joint statement.

Leaders from the country had already spoken of their desire to end the protracted conflict when they came to Medellín in June 2016 for the World Economic Forum on Latin America.

“We want to end the last armed conflict in the Western Hemisphere. The internal armed conflict in Colombia is the last internal war in Latin America. Once we put an end to it, the Americas will be a continent in peace and for progress. We hope to do so as soon as possible,” Juan Manuel Santos, the Colombian president, told participants in the meeting’s opening plenary.

The peace deal brings to a close years of negotiations – many of which ended in failure. Peace talks between the government and rebel forces began back in 2012. But more than three years later, and important differences still remained – particularly related to the question of disarmament – and a 23 March 2016 deadline for signing a final agreement was missed.

But both sides had publicly declared their commitment to reaching a deal, which President Santos reaffirmed in Medellín. “We need to start healing the wounds from a war that has lasted this long,” he said in another session later on in the day.

The stakes could not be higher. A 2013 government commission found that of the more than 250,000 people killed in the conflict, 80% were civilian non-combatants. The unrest and the wider instability it has helped cause has also been a drain on the Colombian economy. In 2011, academics reviewed all the literature on the topic and determined that the cost came to at least 3% of GDP each year – and could have been as high as 15%. Even at the lower estimate, that would amount to 50% less income over 25 years.

While the benefits of peace seem obvious, the negotiation process has not met with unanimous approval. Some in the country aren’t happy with the terms of the agreement, believing that peace shouldn’t come at any cost. “Many Colombians dislike the idea that leaders of the FARC, a murderous Stalinist outfit that has financed itself by drug-trafficking and kidnapping, might end up, through the democratic process, in political control of chunks of countryside or escape punishment for heinous crimes,” the Economist explained.

Acknowledging these reservations, Santos reassured participants that the war’s victims were at the core of the negotiations: “We’ve placed the victims at the heart of this conflict-resolution process. If we want lasting peace, we have to recognize that these people have suffered. The negotiations have been designed around the respect for the rights of these victims – their right to truth, to reparations and to justice.”

 Colombia's conflict in numbers

While the peace deal was greeted with scenes of wild celebration across Colombia, some have expressed concern at the challenges still ahead. It’s been said that implementing the peace agreement and demobilization process – including reintegrating guerilla fighters and replacing the illegal crops they used to finance their operations – could cost Colombia up to $45 billion.

But experts also expect this short-term loss will pay off in the long run. A 2015 government analysis estimated a peace deal would triple foreign direct investment and boost economic growth from 4% to 5.9%.

“We have to see the peace accord as an investment which is costly in the short run but which has very important benefits in the medium and long term,” Daniel Mejia of the University of the Andes told the BBC.

Finding the right balance between peace and justice is one of the biggest challenges when seeking an end to a conflict. Whichever balance is struck, the Colombian people will get the final say, President Santos reaffirmed: “The peace deal needs to be totally acceptable to the people of Colombia. This peace deal should – and will be – endorsed by the Colombian people through a referendum.”

The deal struck will now be put to a referendum.