Colombian President Juan Manuel Santos and the leader of the Farc rebel group have set a six-month deadline to sign a peace deal.
President Santos and the rebel leader known as Timochenko shook hands in Cuba, where the two sides have been holding peace talks since 2012.
On Wednesday, they reached agreement on how to punish human rights abuses committed during the conflict.
The issue had been seen as one of the biggest hurdles on the road to peace.
'Chance for peace'
"We're not going to fail! This is the chance for peace!," President Santos said.
"On 23 March 2016 we will be bidding farewell to the longest-running conflict in the Americas," he added.
"Let's join efforts to achieve peace," Farc leader Timochenko later posted on the rebels' Twitter feed.
The guerrilla group also agreed to surrender its weapons within 60 days of a final accord being signed.
US Secretary of State John Kerry hailed the deal as "historic progress" and expressed his "deep appreciation to Pope Francis for his moral leadership and the Vatican's good offices in the quest for peace".
During his visit to Cuba, Pope Francis had alluded to previous failed peace negotiations between the two sides and warned them that "we can't allow another failure on the road to peace and reconciliation".
The justice deal at a glance
Who will mete out justice?
Special courts and a peace tribunal will be set up to deal with alleged crimes related to the conflict and will try all participants in the conflict, including members of the security forces.
Will there be an amnesty?
Yes and no. Combatants will be covered by an amnesty, but war crimes and crimes against humanity will not fall under it.
Will Farc leaders be sent to jail?
That depends. Those who confess to the most serious crimes will see their "freedom restricted" and be confined, but not in ordinary jails. It is not yet clear where they would serve their sentence instead. Those who confess past a certain deadline or refuse to admit their crimes altogether will go to prison for up to 20 years.
Will the guilty pay for their crimes?
Even those who will not be sent to prison will have to carry out work aimed at repairing some of the damage caused in more than 50 years of conflict, such as helping to clear landmines and plant alternative crops where coca was grown.
President Santos said that he had given his negotiating team instructions to hammer out the outstanding issues before 23 March 2016.
He said it would be "no easy task as many difficult points still need to be agreed".
Since starting official peace talks in Havana in November 2012, the two sides have struck deals on land reform, political participation, illegal drugs and now transitional justice.
However, none of these agreements will come into force until both sides put their signatures to the final agreement.
It will then be put to the Colombian people in a referendum.
While many Colombians have welcomed Wednesday's breakthrough, some - among them victims of the Farc - say it means perpetrators of serious crimes will enjoy impunity.
Former President Alvaro Uribe, a hardliner and harsh critic of President Santos, tweeted that "it's not peace that's near, it's the surrender to Farc and the tyranny of Venezuela" in a reference to the role Colombia's neighbour has played accompanying the talks.
Colombia's armed conflict
•An estimated 220,000 killed
•More than five million internally displaced
•More than seven million registered victims
•About 8,000 Farc rebels continue fighting
Sources: Unit for Attention and Reparation of Victims, Colombian government