Colombia’s government has secured a groundbreaking peace deal with leftist Farc rebels – promising to end a war that wracked the country for more than half a century, killing tens of thousands and displacing millions.

The Colombian president, Juan Manuel Santos, announced on Wednesday that a national plebiscite would take place on 2 October for voters to either accept or reject the accord.

“The war is over,” declared Humberto de la Calle, chief government negotiator, after signing the deal in Havana, where talks have been held since November 2012. “It is the time to give peace a chance.

Iván Márquez, the Farc’s top negotiator, said: “We have won the most beautiful of all battles: [the battle] of peace for Colombia. The battle with weapons ends and the battle of ideas begins.”

With the deal, the Farc – Latin America’s oldest guerrilla group, which took up arms against the state in 1964 under a banner of social justice – renounces its armed struggle and begins its transformation into a legal political party.

“Today marks the beginning of the end of the suffering, the pain and the tragedy of the war,” President Santos said in an address to the nation after the announcement in Havana.

Colombians gathered in a central Bogota square to watch the announcement live on a large screen. They burst into cheers as they watched Márquez and De la Calle sign the deal. “This is a historic moment and I wanted to share it with other people,” said Bogota resident Andrés García.

The comprehensive deal addresses both the root causes of the conflict and its most nefarious consequences, while laying out a calendar for the Farc’s estimated 7,000 fighters to lay down their arms and reintegrate with Colombian society.

“It is the best possible accord,” De la Calle said. “We probably all would have wanted something more but the agreement is the best possible deal.”

Now Colombians will have to decide whether to accept or reject the deal in a plebiscite that polls show could be a tight race.

“Everybody wants peace but not everyone is sure that this peace deal is the right peace deal,” said Peter Schechter, of the Latin America Centre at US-based thinktank the Atlantic Council.

Under the agreement, the government commits to development programmes and addressing gross inequalities in the country’s long-neglected rural sector. It also agrees to widen the opportunities of political participation to smaller political movements, including the party that a demobilised Farc may create.

The Farc agrees to help dismantle and discourage the business of drug crops and trafficking that helped sustain its war financially for the past three decades.

The deal also includes reparations to victims and sets up a transitional justice system for crimes committed during the conflict. Farc members who committed or ordered atrocities but confess their crimes will avoid serving their sentences in jail, instead performing “community service” projects and acts of reparation.

That point is at the centre of controversy surrounding the accords.

Alvaro Uribe, a former president whose government of 2002-2010 unleashed an all-out war against the Farc, is leading the campaign to reject the accords, claiming the deal reached by negotiators is akin to handing the country over to the rebels.

“It took them four years to give everything to the Farc,” said Ernesto Macias, a senator with Uribe’s Centro Democrático party. “They could have done that in one day.”

Critics say the accord should be renegotiated to include jail time for crimes against humanity and a ban on those convicted of such crimes from holding public office. Many Colombians are wary of the Farc who have won the hatred of the public through decades of abuses including kidnapping, indiscriminate mortar attacks of villages and towns and the forced displacement of thousands.

Many Colombians also doubt the government’s capacity to make good on promises of investment in social projects and infrastructure needed to support the peace deal.

“There are many people who are sceptical or against the accords because they don’t trust the Farc and they don’t trust the government either, and they have good reasons for it,” says Kristian Herbolzheimer, a conflict resolution expert with Conciliation Resources who has consulted with negotiators in the Colombian peace process.

One well-known sceptic is Sigifredo López, who spent seven years as a Farc hostage in rebel camps after a guerrilla commando kidnapped him and 11 fellow regional legislators in Cali in 2002. In 2007 all his colleagues were killed in a confused incident that the Farc believed was a rescue attempt. López was the only survivor and after his release was falsely charged with having orchestrated the kidnapping. He was subsequently cleared of all charges.

Although he feels that the Colombian government has conceded too much to the Farc, López is convinced that Colombians need to approve the peace deal. “I would like to see them in jail but it is an act of responsibility with future generations to see this deal through,” he said in a recent interview in his offices in downtown Cali.

Herbolzheimer, the mediator, said that if negotiating the deal was hard, implementing it could prove an even harder task. “The main challenge in any peace process is moving from words to action,” he said.

Potential spoilers abound. Colombia’s smaller guerrilla group, the ELN, says it wants to negotiate a peace deal as well but has shown no sign of being serious about it, continuing to kidnap civilians and attack infrastructure. Renegade members of the Farc could find refuge in the ranks of the smaller guerrilla group.

Organised criminal groups born of demobilised rightwing militias also pose a threat to building peace.

But in a world wracked by conflict, Colombia had become a sign of hope, said Herbolzheimer. “It shows that no matter how complex a conflict is, if there is political will there is a political solution.”