HAVANA: Colombia’s government and the FARC rebels have reached a historic peace agreement to end their half-century civil war that cost hundreds of thousands of lives.

After nearly four years of negotiations in Cuba, the two sides announced a final deal Wednesday, which President Juan Manuel Santos said would be put to a decisive referendum on October 2.

“The Colombian government and the FARC announce that we have reached a final, full and definitive accord… on ending the conflict and building a stable and enduring peace ,” the two sides said in a joint statement read out in Havana by Cuban diplomat Rodolfo Benitez.

“We don’t want one more victim in Colombia .”

In a national address just after the announcement, Santos — who has staked his legacy on the peace process — said the deal marked “the end of the suffering, the pain and the tragedy of war.”

He immediately launched his campaign for a “Yes” vote in the referendum, which he said would be the most important election of voters’ lives.

“This is a historic and unique opportunity… to leave behind this conflict and dedicate our efforts to building a more secure, safe, equitable, educated country, for all of us, for our children and grandchildren,” he said.

Colombians welcomed the announcement with both skepticism and joy, as many took to the streets late Wednesday night, waving the national flag and carrying balloons emblazoned with the word “yes” to show their support for peace .

“It’s hard to believe that we have lived to see such things, it’s historic for the country,” 24-year-old Marcela Cardenas said, before adding that she believes the transformation will be extremely difficult.

Local TV in Colombia’s Caribbean city of Barranquilla showed a rapper chanting “Forward with peace , forward!”

The conflict began with the founding of the Revolutionary Armed Forces of Colombia (FARC) in 1964, at a time when leftist guerrilla armies were fighting to sow revolution throughout Latin America.

Over the years, it has killed 260,000 people, uprooted 6.8 million and left 45,000 missing.

Along the way, it has drawn in several leftist rebel groups and right-wing paramilitaries. Drug cartels have also fueled the violence in the world’s largest cocaine-producing country.

Three previous peace processes with the FARC ended in failure.

But after a major offensive by the army from 2006 to 2009 — led by then-defense minister Santos — a weakened FARC agreed to come to the negotiating table.

Over the past few days, the two sides had been discussing a range of unresolved topics, and worked late into the night Tuesday to draft their joint statement, sources from the two delegations told AFP in Havana.

FARC chief negotiator Ivan Marquez called the accord a new chapter for Colombia .

“We can now say that fighting with weapons ends and with ideas begins,” he said from Havana.

The peace deal comprises six agreements reached at each step of the arduous negotiations.

They cover justice for victims of the conflict, land reform, political participation for ex-rebels, fighting drug trafficking, disarmament and the implementation and monitoring of the accord.

Under the peace deal , the FARC will begin moving its estimated 7,000 fighters from their jungle and mountain hideouts into disarmament camps set up by the United Nations, which is helping monitor the ceasefire.

The FARC will then become a political party. Its weapons will be melted down to build three peace monuments.

Special courts will be created to judge crimes committed during the conflict.

An amnesty will be granted for less serious offenses. But it will not cover the worst atrocities, such as massacres, torture and rape.

Those responsible for such crimes will face up to 20 years in prison, with lighter sentences if they confess.

Santos insisted there would be no impunity for such crimes.

UN Secretary-General Ban Ki-moon congratulated the negotiators for their perseverance, while emphasizing that equal determination will be needed to implement the agreement.

EU foreign affairs chief Federica Mogherini warned in a statement that a number of challenges remain for implementation, but that the deal would bring lasting peace .

On Twitter Erna Solberg, the prime minister of Norway, one of the countries that mediated the talks, congratulated “both parties for a bold step towards a peaceful Colombia .”

Meanwhile the White House said US President Barack Obama had called Santos to congratulate him.

“The president recognized this historic day as a critical juncture in what will be a long process to fully implement a just and lasting peace agreement,” it said in a statement.

Obama vowed continuing support for Colombia , a key ally in the US war on drugs.

Washington has spent more than $10 billion on a joint anti-narcotics strategy called “Plan Colombia” — recently rebaptized “Peace Colombia” by Obama.

Analyst Jorge Restrepo of the Conflict Analysis Resource Center said the agreement allows Colombia to “finally deal with the public policy issues that have been overshadowed by the armed conflict,” such as drugs.

However there are still obstacles on the way to peace .

Santos’s top rival, former president Alvaro Uribe, is leading a campaign to vote “No” in the referendum, arguing his successor has given too much away to the FARC.

And the government is still fighting a smaller rebel group, the National Liberation Army (ELN), whose ongoing kidnappings have derailed efforts to open peace negotiations.