First, they conducted a trilateral meeting along with their key ministers. Then they posed for a jovial “family photo”—complete with an incredibly awkward attempt at a three-way handshake—with Parliament Hill at their backs. Then, after a working lunch in the tranquil Garden Court at the National Gallery of Canada, they emerged to announce what they agreed upon on issues key to the whole continent.

Prime Minister Justin Trudeau described his first North American Leaders’ Summit as “friendly, as you might expect among friends,” but also poignant. It was Mexican President Enrique Peña Nieto’s first official visit to Canada, and the last for outgoing U.S. President Barack Obama, and so the only time this particular iteration of “Three Amigos” would get together for trilateral talks. At the mention of his impending retirement, Obama flashed a cartoonish, wide-eyed thumbs-up at the assembled press corps, drawing laughter.

Last week’s shocking Brexit vote in the U.K.—or more specifically, a repudiation of it—was a constant theme woven through the comments of the three leaders. Peña Nieto remarked that sometimes the things one has are not valued enough until they’re lost, and he championed what NAFTA has created on this side of the Atlantic. “In our three countries, we see opportunities growing and reaching out to more people,” he said.

Obama appeared puzzled and exasperated by the very thinking underlying Britain’s impending disentanglement from the EU. “The integration of national economies into a global economy—that’s here, that’s done,” he said. “The question is: under what terms are we going to shape that economy? And it is my firm belief that making sure how we trade, how we exchange goods—shaping those in accordance with the values our three countries care deeply about is going to be good for us.”

Journalists at the press conference referenced the inflammatory rhetoric of Donald Trump’s election campaign in their questions. But among the three leaders, the candidate himself was treated like Harry Potter’s Voldemort, studiously unmentioned by name. Trudeau and Peña Nieto both refused to take the bait when asked for their opinions on the presumptive Republican nominee, and instead both stressed very carefully that they would respect and work with whomever Americans chose in November.

Obama, however, was not in quite so delicate a mood. At the end of the press conference, unprompted by any question, he took lengthy exception to one of the terms that has been used widely to describe Trump’s support. “They don’t suddenly become a populist because they say something controversial to win votes,” he said. “That’s not the measure of populism. That’s nativism or xenophobia, or worse. That’s cynicism.” Then Obama wrapped up by chuckling to himself and jokingly apologizing for seizing the opportunity afforded by the end of his term to go on “these occasional rants.”

As anticipated, the big issues on which the three leaders reached agreements were the environment, trade and movement of citizens across North America. Here are a few of the highlights that emerged from the whirlwind day of negotiations and glad-handing:

Environment

The three nations have agreed to a goal for North America to reach 50 per cent clean power generation by 2025. Under the auspices of what Trudeau called the “ambitious and enduring” North American Climate, Clean Energy, and Environment Partnership, this will be accomplished through “aggressive” domestic policies, collaborating on cross-border energy transmission projects, a joint study on adding more renewable energy sources to the grid across the continent, more collaboration between the three countries on government purchasing decisions such as energy-efficient vehicles, and, by 2019, aligning 10 energy efficiency equipment standards or tests across all three countries so products can move about more seamlessly. All of this together is touted to create thousands of jobs and boost a green economy.

“We will respond directly and decisively to the challenge of climate change, working to make our own countries more resilient as we encourage others to do the same,” Trudeau said. “This is what can happen when countries come together in pursuit of a common goal, when we have a big idea and the political will to make it happen.”

Also during this trilateral agreement, Mexico signed on to reduce its methane emissions from the oil and gas sectors by 40 to 45 per cent by 2025—a target that was agreed to by Canada and the U.S. during Trudeau’s state visit to Washington in March.

Trade

Against the backdrop of Brexit and Trump’s promises to rip up NAFTA, there were strong, repeated pro-trade co-operation messages from all three leaders. They said the meeting was an opportunity to reaffirm their desire to beef up economic integration across North America. Peña Nieto said the Trans-Pacific Partnership is a chance to further strengthen ties among the NAFTA nations and export the “advantages, benefits and beauties” of that relationship eastward to Asian countries once the TPP is ratified. “We are fully convinced that by working together…we can be the most competitive region in the world,” he said.

Canada, the U.S and Mexico have agreed to produce trilateral “cluster maps” as soon as possible, which will bolster trade and help with decision-making by laying out webs of economic ties across borders. They will also work to align product standards and regulations across the continent, making it easier for small businesses to export their goods across domestic borders.

Visitors

The Liberal government announced on Tuesday that as of Dec. 1, 2016, Mexican citizens will no longer need visas to visit Canada. Wednesday’s trilateral talks produced another resolution to facilitate seamless travel throughout North America: Mexico plans to implement the same electronic entry kiosks and programs used at airports throughout Canada and the U.S. “By the end of this year, we’ll have a single trusted-traveller program for all three of our countries, which will make it easier to travel while at the same time improving security,” Obama said.