The fate of the 52-year war between Colombia and the FARC has been uncertain since the referendum nearly six weeks ago. Polls had indicated that the measure would be approved by a large margin, and the government had even held a signing ceremony with the rebels the week before.
But a vigorous campaign emerged against the deal, and it was rejected by 50.2 percent of voters.
The prospect of peace remained widely popular in Colombia, but for many, the terms of the deal did not offer justice after generations of conflict. Scenes of guerrilla fighters donning civilian clothes and preparing to enter politics touched a nerve for many voters who did not feel that the group had shown remorse for past crimes.
The two sides, which have been holding talks in Cuba for four years, said the revised plan incorporated proposals from the opposition and others groups.
The new agreement is not expected to be put to another popular vote, but rather submitted to Congress.
"We have reached a new final agreement to end the armed conflict, which incorporates changes, clarifications and some new contributions from various social groups," the two sides said in a statement.
It was read by diplomats from Cuba and Norway, the mediating countries, in the Cuban capital, Havana.
The statement did not give details of the revised agreement but Colombia's lead negotiator, Humberto de la Calle, said it "resolves many criticisms" of the previous deal.
One new requirement was for the Farc to draw up a complete list of its assets, to be used for victim compensation, he added. Further details are expected to be released over the week.
Ricardo Avella G