Thousands of Colombians are celebrating the historic peace agreement between the government and left-wing Farc rebels, signed after 52 years of conflict.
The announcement was broadcast live on Wednesday from Havana, Cuba, where peace talks have been held for more than two years.
The conflict has killed an estimated 220,000 people and displaced millions.
President Juan Manuel Santos called the deal “the beginning of the end to the suffering, pain and tragedy of war”.
A joint statement by both parties read: “The Colombian government and the Farc announce that we have reached a final, full and definitive accord.”
The head of the Colombian delegation, Humberto De la Calle, and the chief Farc negotiator, Ivan Marquez, signed the agreement at a ceremony in Cuba.
Both sides have agreed to work together to address social exclusion, to deliver justice to the victims of the conflict and build a stable and enduring peace.
“We have reached our goal,” said De la Calle.
“The war is over but also there is also new beginning. This agreement opens the door to a more inclusive society,” he added.
In Bogota, hundreds of people, many dressed in white, gathered at different points of the city waving the Colombian flag and cheering.
57-year-old Orlando Guevara spoke to journalists, saying “I can die in peace because finally I’ll see my country without violence, with a future for my children.”
Farc negotiator Ivan Marquez said the Farc and the government had “won the most beautiful of all battles: the peace of Colombia”.
Together, the once bitter enemies stood – guerrilla leaders and former generals, foot soldiers and career diplomats – and sang the Colombian national anthem.
In the end their shared understanding of what Colombia is, appears to have won out over their sharp differences as the two sides took their seats to announce the end of almost five decades of fighting.
It has taken nearly four years of talks, which on several occasions looked on the verge of collapse.
The question now, as the peace process moves from Havana back to Bogota, is whether the terms agreed in Havana will be acceptable to the Colombian people. A referendum on the deal is expected in October.
President Barack Obama phoned his Colombian counterpart, Juan Manuel Santos, to congratulate him on the deal.
The White House later released a statement saying that “president (Obama) recognised this historic day as a critical juncture in what will be a long process to fully implement a just and lasting peace agreement that can advance security and prosperity for the Colombian people.”
Under the terms of the agreement, the Farc will give up its armed struggle and join the legal political process.
“There is no room for winners or losers when you achieve peace through negotiations,” tweeted Farc negotiator Rodrigo Granda, adding that “Colombia wins, death loses.”
The left-wing rebels have been fighting Colombian government since 1964; the longest-running conflict in Latin America.
The deal will need to be approved by Colombians in a popular vote, which will take place on 2 October, Mr Santos announced.
“It will be the most important election of our lives,” he said on national television shortly after the deal was signed.
However, former President Alvaro Uribe is leading the campaign to get the agreement rejected.