Laura Dawson is director of the Canada Institute at the Wilson Center in Washington.

Sometimes good diplomacy means doing the opposite of what your impulses tell you to do.

This week Prime Minister Justin Trudeau was in Washington to meet with U.S. President Donald Trump, Speaker of the House Nancy Pelosi and Senate Majority Leader Mitch McConnell. A lot has happened since the Prime Minister’s last visit two years ago. During more than a year of mercurial trade negotiations, the President habitually threatened to pull the plug on cross-border trade. Tariffs on steel and aluminum left Canadians feeling aggrieved that their country was being branded a national security threat. And, most recently, Canada’s habit of co-operating with the United States has landed it in an extradition dispute that is threatening the lives of Canadians imprisoned in China and undercutting the sustainability of China-Canada trade.

Story continues below advertisement

Over the past two years, Mr. Trudeau has endured his share of personal attacks from the President. He was called “dishonest” and “weak” when he objected to U.S. steel and aluminum tariffs. It would be understandable, therefore, for him to want to keep the President at arm’s-length and let him manage his own promotion of USMCA to Congress. Instead, Mr. Trudeau came to Washington to act as something of a bridge-builder between the White House and House Democrats – offering a “seal of approval” on contested issues.

The Prime Minister’s endorsement may not move any mountains in Congress, but it will make it more difficult for the Democrats to sustain the message that the trade deal is no good for labour and the environment if progressive Canada has already given it the nod.

The Canadian trip to Washington this week was very different from previous visits, where we have seen teenage girls line up on the street hoping to get a selfie with the famous Prime Minister. While Mr. Trudeau and his cabinet have always been well received by like-minded audiences of mostly Democrats, the Canadians were not seen as particularly influential by those with whom they were not already ideologically aligned.

This week, a different Canadian delegation travelled between the White House and the Capitol – one that is seasoned and has internalized some important lessons:

Alliances matter. Over the past 18 months, Mr. Trudeau and his team have made allies of senior Republicans by linking U.S. votes and jobs to the cause of cross-border trade. They have worked in tandem with Conservative MPs and premiers, recruited for their more natural grasp of the Republican language.

Over the past 18 months, Mr. Trudeau and his team have made allies of senior Republicans by linking U.S. votes and jobs to the cause of cross-border trade. They have worked in tandem with Conservative MPs and premiers, recruited for their more natural grasp of the Republican language. Strategy matters. Throughout months of acrimonious trade talks, Foreign Affairs Minister Chrystia Freeland defended core Canadian interests but always resisted the impulse to let harsh words provoke her into retaliation. To paraphrase Michelle Obama, she never went low.

Throughout months of acrimonious trade talks, Foreign Affairs Minister Chrystia Freeland defended core Canadian interests but always resisted the impulse to let harsh words provoke her into retaliation. To paraphrase Michelle Obama, she never went low. Relationships matter. Ambassador David MacNaughton worked closely with U.S. Ambassador and White House insider Kelly Craft to keep the lines of communication open during the most difficult days of the negotiations. Even though they didn’t agree on everything, Ms. Craft and Mr. MacNaughton made sure that important messages were received and understood by people who mattered.

When Mr. Trudeau’s plane landed in the U.S. capital this week with little public fanfare, an astonishing number of Washington’s most powerful influencers attended a welcoming reception for him at the Canadian Embassy. They included Speaker Pelosi, Treasury Secretary Steven Mnuchin, White House senior counselor Kellyanne Conway, U.S. Chamber of Commerce president Tom Donohue and International Monetary Fund managing director Christine Lagarde. Most surprising, perhaps, was that Ms. Craft, after a gruelling day of Senate confirmation hearings for her new role as UN ambassador, dressed six of her grandchildren in Raptors jerseys to greet the Prime Minister at the airport.

To be received as an equal by many of Washington’s most connected decision-makers is a clear signal that the Prime Minister and his team have figured out how to get things done in a town that does not tend to value loyalty or friendship.

Mr. Trudeau’s team cannot overcome all of the gaps in influence – Canadian votes don’t affect the outcomes of U.S. elections. They cannot credibly threaten instability: No matter how badly you treat Canadians they will still be good trading partners and behave themselves at the border. But Mr. Trudeau’s people have learned how to align themselves with the powerful Americans who can mobilize jobs and votes in the U.S. while also helping to advance Canada’s interests.

Story continues below advertisement

Within this framework, Canada has become a strong and complementary ally. On foreign policy, Canada has used its consensus-building skills to help the U.S. generate support for regime change in Venezuela. On trade, Mr. Trudeau is helping the President persuade Congressional holdouts that the USMCA trade deal is a great one. Even though Mr. Trudeau might not feel personally inclined to help a president who has treated him so poorly, his performance in the White House this week is a lesson in doing the right thing for the relationship, even if you have to swallow your pride to do so. The President’s subsequent commitment to help Canada manage diplomatic rifts with China is proof that Mr. Trudeau’s U.S. engagement strategy is working as intended.

Future historians may characterize the Trump-Trudeau era as one of the seminal periods of bilateral diplomacy. It is easy to be allies when everyone gets along and personalities mesh. It is much more difficult to get things done when the leaders are not a natural fit and priorities clash more often than they align. Persistence, strong relationships, linkage of interests, and a long-term strategic focus are the keys to working through these challenges.