CARTAGENA, Colombia — Colombia’s government and the country’s largest rebel movement signed a historic peace accord Monday evening ending a half-century of combat that caused more than 220,000 deaths and made 8 million homeless.

Underlining the importance of the deal, President Juan Manuel Santos and Rodrigo Londono, leader of the Revolutionary Armed Forces of Colombia, signed the 297-page agreement before a crowd of 2,500 foreign dignitaries and special guests, including U.N. Secretary-General Ban Ki-moon and U.S. Secretary of State John Kerry.

Many in the audience had tears in their eyes, and shouts rose urging Santos and Londono to “Hug, hug, hug!” But in the end, the two men just clasped hands and the rebel commander, also known as Timochenko, put on a pin shaped like a white dove that Santos has been wearing on his lapel for years. Seconds later five jets buzzed overhead in formation trailing smoke in the colors of Colombia’s flag.

CELEBRATING PEACE

During a minute of silence for the war’s victims, 50 white flags were raised. Everyone at the event wore white as a symbol of peace.

“Viva Colombia,” Ban shouted at the conclusion of his speech welcoming the peace deal.

Earlier in the day, Santos and foreign dignitaries attended a Mass celebrated by Cardinal Pietro Parolin, the Vatican’s secretary of state, at a baroque church named for St. Peter Claver, a 17th century Jesuit priest revered as the “slave of slaves” for his role aiding tens of thousands of African slaves brought to the New World as chattel.

In a stirring homily, Pope Francis’ envoy praised Colombians for overcoming the pain of the bloody conflict to find common ground with the rebels.

“All of us here today are conscious of the fact we’re at the end of a negotiation, but also the beginning of a still open process of change that requires the contribution and respect of all Colombians,” the cardinal said.

Across the country Colombians marked the occasion with a host of activities, from peace concerts by top-name artists to a street party in the capital, Bogota, where the signing ceremony was to be broadcast live on a giant screen. It was also celebrated by hundreds of guerrillas gathered in a remote region of southern Colombia where last week top commanders ratified the accord in what they said would be their last conference as a guerrilla army.

The signing didn’t close the deal, however. Colombians will have the final say on endorsing or rejecting the accord in an Oct. 2 referendum. Opinion polls point to an almost-certain victory for the “yes” vote.

DECIDING ON WAR CRIMES

Among the biggest challenges will be judging the war crimes of guerrillas as well as state actors. Under terms of the accord, rebels who lay down their weapons and confess their abuses will be spared jail time and be allowed to provide reparations to their victims by carrying out development work in areas hard hit by the conflict.

That has angered some victims and conservative opponents of Santos, a few hundred of whom took to the streets Monday to protest what they consider the government’s excessive leniency toward guerrilla leaders responsible for scores of atrocities in a conflict fueled by the country’s cocaine trade.

To shouts of “Santos is a coward!” former President Alvaro Uribe, the architect of the decade-long, U.S.-backed military offensive that forced the FARC to the negotiating table, said the peace deal puts Colombia on the path to becoming a leftist dictatorship in the mold of Cuba or Venezuela – two countries that along with Norway played a vital role sponsoring the four-year-long talks.

“The democratic world would never allow bin Laden or those belonging to ISIS to become president, so why does Colombia have to allow the election of the terrorists who’ve kidnapped 11,700 children or raped 6,800 women?” he told protesters gathered in a working-class neighborhood on the outskirts of Cartagena.