LONDON — It was an “extraordinary, intense negotiation,” like a seesaw with the “stakes for failure being raised hour by hour,” Britain’s former prime minister, Tony Blair, said Monday of the negotiations leading to the landmark Good Friday Agreement, signed on April 10, 1998.

“I didn’t know we were going to get an agreement until literally minutes before it happened,” he told a gathering of reporters in London. “We thought we had lost it several times.”

Twenty years later, the deal is under threat, not least from Britain’s decision to withdraw from the European Union, or Brexit, which Mr. Blair opposes. He has also appealed to voters in Northern Ireland, where the agreement faces separate problems and the government has all but ceased functioning, to “stand up” for the pact.

On Tuesday Mr. Blair is expected to join former President Bill Clinton and Bertie Ahern, a former Irish prime minister, to mark the anniversary of the Good Friday Agreement, which bound former political enemies in Northern Ireland in a commitment to end a deadly sectarian conflict known as the “Troubles.”