Donald Trump Jr. had just posted a batch of private messages he exchanged with WikiLeaks during last year’s campaign, confirming reports that he communicated with the website that published stolen Democratic emails obtained by Russian military intelligence.

“More nothing burgers from the media and others desperately trying to create a false narrative,” the president’s oldest son wrote on Instagram. “Keep coming at me guys!!!”

Over the course of the week, Trump Jr. went on to tweet or retweet criticism of his father’s 2016 rival, Hillary Clinton; actor George Takei; Sen. Charles Schumer, D-N.Y.; and former Vice President Joe Biden, sharing unsubstantiated claims about him from an anonymously sourced blog post.

Faced with deepening scrutiny of contacts he had in 2016 with people tied to Russia, the 39-year-old has adopted a provocative response: defiance.

In public appearances and on Twitter, Trump Jr. has taken an increasingly caustic tone, mocking critics and shoving himself into the scrum of the country’s most polarizing debates.

It’s an unorthodox legal strategy for someone under scrutiny by congressional investigators, whose every word could be used against him. But the approach fits with the real estate executive’s growing public persona as a right-wing provocateur and ardent defender of Trumpism.

“He’s very smart to be in the spotlight,” said Charlie Kirk, a friend and the founder of the conservative college and high school group Turning Point USA. “Would they stop the investigation if he stopped tweeting? He’s in a situation where either you defend yourself, reassure the base, reassure the supporters, or stay silent. And if you’re totally silent, it only increases suspicion.”

The Trump base is with him, Kirk added: “Most people can’t even keep up with this stuff, anyway.”

The Russia-related controversies have heightened Trump Jr.’s rising profile. Once a supporting character on his father’s reality show, the vice president of the family business is now an in-demand figure on the paid speaking circuit and a political player all his own.

Last month, he delivered a speech on the field of the cavernous Dallas Cowboys stadium, sounding off to a group of University of North Texas donors about “liberal imperialists,” media “vitriol” and universities that “train your children to hate our country.”

Within hours, Trump Jr. was back on Twitter lashing out at his father’s targets, from Republican Sen. Jeff Flake (“liberal globalist”) to Clinton (“arrogance and entitlement”) to “opposition” protesters (“apparently my 3 year old is consulting”).

Trump Jr.’s attorney, Alan Futerfas, said that the president’s son is exercising his freedom to speak his mind as a private citizen.

“He is simply voicing thoughts and concerns and his hopes for America that he shared on the campaign trail,” Futerfas said in an interview. Friends say the flame-throwing by Trump Jr. is merely the response of a loyal son.

“If you were him and watching the mainstream liberal media attack your father day after day, it would get kind of tiresome and you’d react, too,” said Doug Deason, a wealthy Dallas donor who joined Trump Jr. last month for a fundraising-strategy session.

Others see grander ambitions. He is “more of a politician than his father,” said Louise Sunshine, a former Trump Organization executive.

Trump Jr. did not always appear destined to follow his father’s path, moving to Aspen after college for a year of fly-fishing and bartending. But by the time his father launched his White House bid, Trump Jr. was a key purveyor of the family brand, having joined the family business and co-starred as a “boardroom advisor” on Trump’s reality show “The Apprentice.”

He traveled almost constantly for 18 months as his father’s surrogate, mixing his outdoorsman bona fides with sharp swipes at Clinton, at one point warning she would reshape the United States into a “socialist state.”

After the election, Trump Jr. and his brother took over managing the Trump Organization, which their father still owns. Eric Trump told The Post in February that “the company and policy and government are completely separated. We have built an unbelievable wall in between the two.”

This year, Trump Jr. attended the openings of a Trump-brand hotel in Vancouver and a luxury golf complex in Dubai. Later this month, when his sister, Ivanka, heads to India as part of a White House trip, Trump Jr. will travel there, too, to help launch two Trump-branded tower projects in Kolkata and Gurgaon.

But much of his public calendar appears dominated by politics rather than business. In recent months, he has headlined Republican dinners, fundraisers and rallies in Indiana, Texas and Montana.

Some organizers said they broke fundraising records after donors flocked to hear his stories of life as a Trump. At one event for the Indiana Republican Party in May, captured on video by organizers, he said the first person to call his brother when Eric was expecting his first child wasn’t his father, but Vice President Mike Pence.

Last month, a day after the Trump hotel division announced it had hired a new vice president, Trump Jr. was hunting pheasants with a shotgun alongside U.S. Rep. Steve King, R-Iowa, one of his father’s top supporters.

Presidential children traditionally serve to soften and humanize their fathers, reminding voters that the nation’s leader can be a family man, too. But Trump Jr. has sharpened Trump’s already-pointed edges, often amplifying his father’s grudges.

On Twitter, he regularly jabs at the president’s antagonists, from liberal media personalities to Republican politicians to kneeling football players. Responding on Tuesday to a CNN guest’s claim that Trump rarely attacks white men, Trump Jr. rattled off 19 of his father’s white-male targets in a single tweet, including former president George W. Bush and current attorney general Jeff Sessions.

He often retweets or references far-right voices, as well as websites aimed at conservatives, such as Gateway Pundit, the Federalist and Breitbart News. Earlier this month, he retweeted a comment that the Clintons were “an unscrupulous gang of thugs” and noted a fringe-right conspiracy alleging that the couple covered up a murder.

In more than 400 tweets last month, he referred to his company only once, retweeting one of its posts offering “thoughts and prayers” after the Las Vegas shooting massacre.

In the coming weeks, Trump Jr. will appear at a $200-a-person fundraiser in Kansas for gubernatorial candidate Kris Kobach, a torchbearer for Trump’s voter-fraud crusade, and keynote a Turning Point USA banquet for thousands of students in Palm Beach, Florida.

Kirk, the group’s founder, said the event received hundreds of new applications when Trump Jr.’s attendance was announced.

“Part of what makes Don’s brand unique is he’s not afraid to push the envelope, not afraid to push the boundaries and call people out,” Kirk said.

Trump Jr.’s public bravado comes as he faces persistent questions about what multiple Russia probes will reveal about the role he played during his father’s White House run.

Along with the messages he exchanged with WikiLeaks, Trump Jr. met at Trump Tower in June 2016 with a Russian lawyer in hopes of getting damaging information on Clinton. “I love it,” he wrote to an associate about the possibility that the lawyer would have material on the Democratic candidate.

Trump Jr. testified privately in September for five hours before a Senate committee and said in a statement that he “did not collude with any foreign government and (does) not know of anyone who did.”

But he faces growing calls by Democratic lawmakers to participate in a public hearing and answer questions about any knowledge he might have about Russia’s effort to boost his father’s campaign.

Sen. Dianne Feinstein of California, the top Democrat on the Senate Judiciary Committee, told CNN in September that she expected Trump Jr. to take part in a hearing “come hell or high water.”

Meanwhile, some of Trump Jr.’s friends said he is struggling with a more fundamental frustration: craving more of a connection to the man he called at the Republican National Convention “my mentor, my best friend.”

In February, Trump Jr. told The Post he had spoken briefly with his father but said “he’s got real stuff he’s got to deal with.” He told the New York Times earlier this year, “I feel ridiculous bothering him.”

“Don barely talks to his father, and they barely see each other,” said one person close to him who spoke on the condition of anonymity to discuss private conversations. “It weighs on him. It does. … It didn’t really hit him until laying the wreath before inauguration that this is so much bigger than us, and they’re going to have to make sacrifices.”

Amid his angry online missives are nostalgic posts about the president, whom he dressed up as for Halloween. On the anniversary of the election win, Trump Jr. posted photos of the two hugging and what he called his “favorite piece of campaign memorabilia:” an electoral map signed, “Great job! Thanks, Dad.”

In one video, Trump Jr. says he “had the privilege of being able” to fly with his father to the White House. He can be seen in the helicopter window’s reflection as the president walks away.