By all accounts, President Obama is raring to go after Donald Trump, who in so many ways represents his political antithesis. Obama has already taken a few swipes at Trump, such as in his defense of an internationalist foreign policy during an address to Air Force graduates. But it was in Ottawa this week that the president offered the most extended preview of the arguments he’ll make to American voters.

It was auspicious that the occasion for his visit was the North American Leaders’ Summit, since it’s an outgrowth of NAFTA, a free trade agreement whose repeal has become the center of Trump’s economic platform. Obama offered two lines of critique: a narrower one targeting Trump’s credentials as a populist and, more interestingly, a broader analysis of Trumpism as partly a consequence of globalization, which needs to be answered with a stronger social welfare state.

In a press conference with Canadian Prime Minister Justin Trudeau and Mexican President Enrique Peña Nieto, Obama raised the issue of Trump’s supposed populism. He didn’t name Trump explicitly but the presumptive Republican nominee was clearly the intended object of derision when Obama tried to distinguish between populism and xenophobia:

Somebody else who has never shown any regard for workers, has never fought on behalf of social justice issues or making sure that poor kids are getting a decent shot at life or have healthcare—in fact, have worked against economic opportunity for workers and ordinary people—they don’t suddenly become a populist because they say something controversial in order to win votes.

That’s not the measure of populism. That’s nativism or xenophobia or worse. Or it’s just cynicism. So, I would just advise everybody to be careful about suddenly attributing to whoever pops up at a time of economic anxiety the label that they’re populist.

Obama drew a distinction between pseudo-populism and a genuine populism that aims to improve the lot of working people, such as the populism that animated Bernie Sanders’s campaign.

Later that day, while speaking to the Canadian Parliament, Obama took a more sweeping approach. He used the Brexit vote as an example of how globalism was leaving many behind and opening the door to a politics of xenophobia. Trump was again unnamed but clearly invoked. According to Obama:

If the benefits of globalization accrue only to those at the very top, if our democracies seem incapable of assuring broad-based growth and opportunity for everyone, then people will push back out of anger or out of fear.

And politicians, some sincere and some entirely cynical, will tap that anger and fear, hearkening back to bygone days of order and predictability and national glory, arguing that we must rebuild walls and disengage from a chaotic world, or rid ourselves of the the supposed ills brought on by immigrants, all in order to regain control of our lives.

The answer to the disruptions of globalization is a strengthening of the social welfare state and a return to classic Keynesian principles, which the president evoked by quoting the Canadian-American liberal economist John Kenneth Galbraith:

So we need growth that is broad and that lifts everybody up, including tax policies that do right by working families, and robust safety nets for those who fall on hard times. As John Kenneth Galbraith once said: The “common denominator of progress” is our people. It’s not numbers. It’s not abstractions. It’s how are our people doing.

Taken together, Obama’s two speeches point to a two-pronged response to Trump. One is an attack debunking the real estate mogul’s claims to be a populist. The other is a broader, positive response offering up liberal remedies to the economic dislocation that the president sees as the cause of Trumpism. (In his remarks to Parliament, Obama was also staking out a difference with Bernie Sanders, who he had otherwise praised. In arguing that trade deals were a general good despite their drawbacks (which need to be more aggressively mitigated), Obama’s position was distinct from Sanders’s more general anti-trade deal stance.)

Obama’s remarks were warmly received in Ottawa, where the Liberal majority of Parliament broke out into cheers of “four more years” at the end of the speech. In the coming weeks, we’ll see if Americans are similarly receptive.