It was a slow burn, but President Obama made the audience explode in laughter with the punchline.

During a state dinner in honor of Canadian Prime Minister Justin Trudeau, President Obama delivered lighthearted remarks that included humorous shots at the Republican Party Primary race and the participants.

Obama began by talking about how America and Canada are lands of opportunity and then he turned the birtherism of the GOP around and threw it right back at them in a burn Ted Cruz will feel on the campaign trail.

“This visit has been a celebration of the values that we share,” Obama began.

“We as a people are committed to the principles of equality and opportunity. The idea that if you work hard and play by the rules you can make it if you try no matter what the circumstances of your birth in both of our countries.”

Obama started out serious and thoughtful, setting up those in attendance for what would be a hilarious joke at Ted Cruz’s expense, thus once again demonstrating his mastery of comedy.

“We see this in our current presidential campaign. Where else could a boy born in Calgary run for president of the United States?”

Here’s the video via YouTube.

For years, Republicans have claimed that President Obama is illegitimate because they say he wasn’t born in the United States even though records clearly prove that President Obama was born in Hawaii to an American mother in 1961.

But during this GOP Primary, Ted Cruz has been running for president even though he really was born in a different country, and only Donald Trump has repeatedly pointed that out throughout the race while other Republicans hypocritically remain silent.

But President Obama also alluded to Trump in a separate joke, mentioning how Canada is welcoming Americans into their nation if Trump somehow wins the presidency and how our neighbors to the North refuse to build a wall to keep us out in our time of need.

“Where else would we see a community like Cape Breton, Nova Scotia welcoming Americans if the election does not go their way? And to the great credit of their people, Canadians from British Columbia to New Brunswick have, so far, rejected the idea of building a wall to keep out your southern neighbors. We appreciate that. We can be unruly, I know.”

President Obama’s humor and quick wit will be sorely missed when he leaves office in 2017.