PARIS — It took almost two weeks for negotiators from 195 countries to finally pass the landmark climate accord this weekend after several espresso-fueled all-nighters and long, passionate debates over the meaning of a single word, such as “shall.”

But the story of how the deal came together started long before that — in December 2009, with the failure of the last such summit meeting, in Copenhagen.

That gathering was, in hindsight, a case study in how not to do a deal. The hosts of the event had set a stern tone, with concrete barricades, concertina wire, and steel cages to house protesters who stepped out of line.

Connie Hedegaard, Denmark’s minister of climate and energy, was blunt in her approach, “putting pressure on all governments to make the political price of being an obstacle so high that no one will pay it,” she said at the time.