WASHINGTON — Fresh from a brush with political death last month, the newly bearded Sen. Ted Cruz cracked jokes at a black tie dinner with journalists in a speech laced with some wicked jabs — many aimed at the president and himself.

“As a Republican, I believe everything happens for a reason,” Cruz said. “The 2016 race was meant to teach me humility. Beto’s candidacy was meant to teach me humility when the first time didn’t take.”

Much of the Texas senator’s routine at Saturday night’s Gridiron dinner focused on his close call against Rep. Beto O’Rourke. The El Paso Democrat held Cruz below 51 percent and raised a whopping $70 million, a showing so strong that Democrats nationwide have urged O'Rourke to run for the White House.

“I know that all of you in the media were betting big on Beto. And what gets me is that you still are,” Cruz said.

“I’m starting to see a disturbing pattern. ... I took on Trump. He became president. I beat O’Rourke, and somehow that’s launched Beto 2020. ... It’s like there’s some unspoken rule that anybody is presidential timber once they have proven they’re not Ted Cruz.”

Cruz poked plenty of fun at himself — “what my friend Rick Perry calls self-defecating humor.”

There's no record of the energy secretary and former Texas governor saying that, though he did have that "oops" moment in a GOP debate in 2011. The spring 2012 dinner put Perry on the road to recovery. He joked that his short presidential campaign amounted to "the three most exhilarating hours of my life."

Poetic license isn’t forbidden by the Gridiron, a group of journalists that throws dinners twice a year devoted to satirical songs and camaraderie.

Abigail Spanberger, a former CIA officer elected to Congress last month in Virginia, spoke for the Democrats. Both were well-received and both, per tradition, paid homage to the role of a free press.

“What separates us from authoritarianism is not principally the Second Amendment or the 10th, but the First,” Cruz said. “An independent, even adversarial press is baked into the Constitution. I don't always like it but I will always defend it, because the alternative is unthinkable and un-American.”

This was Cruz's second Gridiron appearance. He used the 2014 spring dinner, five months after a government shutdown that left him exceedingly unpopular in Washington, to rebuild his image.

And as he recalled, he succeeded in making himself “slightly less odious to you than usual. ... The only problem is impressions are fleeting and I’m afraid we might need to make this an annual event.”

Most politicians would be wise enough to avoid a second try. Most would see no need for a frivolous ego boost, Cruz said. “But you know your man. I said yes.”

Even in years he hasn’t appeared, Cruz has been a presence.

At the 2016 dinner, Vice President Joe Biden called him an “inspiration to every kid in America who worries that he’ll never be able to run for president because nobody likes him.”

Republican presidential candidates Donald Trump and Ted Cruz argued a point during a presidential primary debate at Fox Theatre in Detroit in March 2016. (Paul Sancya / AP)

Trump squabbles

Cruz’s rapprochement with President Donald Trump after their 2016 rivalry provided much of the senator’s comedic fodder.

He noted that this fall, “my presidential sobriquet went from `lyin’ Ted’ to `beautiful Ted.’ ”

"Sometimes you just have to put minor squabbles behind you. You know, like whether or not your dad was the guy on the grassy knoll," he said, alluding to an unfounded National Enquirer report linking his father to the John F. Kennedy assassination.

Trump cited that tale during the primaries.

The Enquirer has repeatedly shielded him, as when it bought the rights to Playboy model Karen McDougal's story of a sexual liaison, then quashed it. Cruz alluded to that, setting up the punchline with a riff about how Elvis and Utah Sen. Orrin Hatch are probably the same person.

"To my friends at the Enquirer, I'm just saying, this story is too good to just catch and kill," Cruz said.

Senate Majority Leader Mitch McConnell used to see him "as the most unreasonable, uncivil, uncontrollable person he could imagine." Something, he said, seems to have changed since Trump came to town.

Cruz also quipped that he's used his influence with Trump to urge him to pick "Robert Francis O'Rourke" as ambassador to Ireland — partly as a favor to Sen. John Cornyn, who faces re-election in 2020, possibly against O'Rourke.

"What really sold Trump was when I told him that he speaks fluent Irish," Cruz said.

Snowflake the dog

Cruz made a sly joke about the millennials who flocked to O’Rourke in such numbers they put a scare into his own team.

“I said what more do you want from me? I already named my dog Snowflake,” he said. He’s a white fur ball, with “his own safe space” — what some might call a dog crate.

“Heidi and I strive constantly to protect the self-esteem of our precious, delicate, unique little progressive house pet,” Cruz said. “We even told him you can even self-identify as a cat if you like.”

Supreme Court nominee Brett Kavanaugh (Andrew Harnik/The Associated Press) (Andrew Harnik / AP)

Kavanaugh fight

During the Brett Kavanaugh confirmation fight, protesters drove Cruz and his wife, Heidi, from an upscale Italian restaurant near the Capitol.

Cruz praised the Gridiron meal of ribeye filet as “a break from a demanding regimen that I’ve been following lately called the Cruz diet: I dine out. I take a few bites, and then I get a little cardio getting chased by an angry mob.”

He returned to the newest Supreme Court justice, whose hearings revealed heavy partying as a teen.

“The Kavanaugh hearings gave us all plenty to think about,” Cruz said, “as I did one quiet evening by the fireplace, watching the flames consume my high school yearbook.”

Sen. Ted Cruz left the weekly Senate Republican policy luncheon in the U.S. Capitol in late November. (Chip Somodevilla / Getty Images)

Kinder, gentler and bearded

Cruz has been sporting a beard the last two weeks, his first since college.

He called it his “Wolf Blitzer look,” though he said that John Bolton, the mustachioed national security adviser, says he looks more like Mahmoud Ahmadinejad, the former Iranian president.

Cruz acknowledged that he put on a bit of weight during the campaign.

“Maybe it's the general influence of Christmastime, but I'm just bursting with benevolence and goodwill,” he said. “I don’t even recognize myself.”

Humbled and re-elected, Cruz said, he’s back in Washington for another term, “only this time nicer, more agreeable more open-minded — on a personal journey that I simply think of as getting back to my Canadian roots.”