Adam Isacson, an analyst at the Washington Office on Latin America, said the rebels had made concessions, too, including dropping longstanding demands for radical land and economic reforms as a condition for peace. They also agreed to a six-month timetable to abandon arms, despite concerns that they might be hunted by paramilitary groups.

“In the FARC’s view, they gave up a lot of ground,” Mr. Isacson said.

Pollsters struggled to explain why the result had defied the forecasts. César Valderrama, the director of Datexco, who had predicted a double-digit win for the agreement, said the “no” vote had risen in reaction to the celebratory signing ceremony that took place before Colombians went to the polls, an act of political stagecraft that apparently backfired on the government.

Many “yes” supporters also believed the referendum was coasting to victory, so they did not feel the need to vote, Mr. Valderrama said.

“They already felt like winners, and as winners, it wasn’t necessary to vote,” he said.

Even those who backed the “no” campaign said they were stunned by the result.

“I always said that the difference wasn’t going to be much, but I never thought we were going to win,” said Santiago Valencia González, a right-wing Colombian congressman representing the northern Antioquia region, which voted against the agreement.

Mr. Valencia said the Colombian right would begin pressuring the government to pursue peace on new terms. “I think it’s a great opportunity for Santos to listen to us,” he said in an interview in Medellín.

Some who voted for the deal said they liked the idea of peace a lot better than the specifics of the agreement. José Barbosa, the owner of a bakery in northern Bogotá, recalled fleeing a region of central Colombia because his neighbor’s sons were being recruited by rebels and he feared that the same would happen to his children.