NEW YORK — Already enjoying its best ratings in eight years with politically charged comedy, “Saturday Night Live” got something even more beneficial with Donald Trump’s potshots — validation.

Hours after seeing himself portrayed by Alec Baldwin opposite Kate McKinnon’s Hillary Clinton impersonation for the third straight week, the Republican presidential candidate took to Twitter to complain. He called the opening skit a hit job, and said Baldwin’s impersonation stinks. “Time to retire the boring and unfunny show,” Trump tweeted.

“Trump doing this is like an endorsement for the rest of the world,” said David Bianculli, author of the upcoming book “The Platinum Age of Television.”

Less than a year ago, the venerable NBC late-night show earned big ratings — and a lot of heat — for having Trump as a guest host. Critics savaged the show. NBC, which that summer had gone out of the beauty pageant business with Trump after his comments about Mexican immigrants and cut ties with him on “Celebrity Apprentice” after he announced his presidential bid, was questioned about whether it was inconsistent to bring him on as “SNL” host.

During its first two weeks on the air this fall, NBC had bigger season-opening audiences than at any point since Tina Fey was doing her memorable Sarah Palin impersonation in 2008, the Nielsen company said. Based on preliminary ratings, this past Saturday’s third week will be the same.

The season-opening audience of 8.3 million viewers beat the 2015 debut’s count of 6.3 million, Nielsen said. But that’s only a partial illustration of the show’s reach: add in people who watched a recording or on-demand stream within a week, and viewership bounced to 12.2 million.

Additionally, more than 36 million people watched a clip of that show’s opening skit with Baldwin and McKinnon on Facebook or YouTube, NBC said. Some others likely watched on other sites, including NBC’s own.

“Saturday Night Live” is well-attuned to the political calendar. It is opening the season with four straight live episodes, will take a break Oct. 29, and will be back on the Saturdays immediately before and after the election.

“Presidential campaigns for ‘SNL’ are like when you gather nuts for the winter,” said James Andrew Miller, co-author with Tom Shales of “Live From New York: The Complete, Uncensored History of ‘Saturday Night Live.'” “You try and get new eyeballs and bring people into the tent who either haven’t seen it or haven’t seen it for a while and get them hooked.”

Trump’s criticism is likely to get people who heard it to check and see what he was so angry about, he said. There’s already some evidence of this: in only a day, an estimated 9.3 million people had checked out video of the opening skit on Facebook or YouTube, sure to pass the 10 million who saw the second week’s opener.

“If Donald Trump is against you, it means something,” Bianculli said. “I’m sure if he watched John Oliver or Bill Maher, he’d be just as outraged. Good for ‘Saturday Night Live’ for still being in the conversation.”

Despite the negative tweet, Trump would do well to consider a cameo on “SNL” for the Saturday before the election, as John McCain did in 2008. Palin also appeared side-by-side with Fey earlier that fall. “Saturday Night Live” is much kinder to politicians when they’re actually in the room, Miller said.

“They are very aware of a candidates’ comfort level,” he said.

This fall has been a challenge for the “Saturday Night Live” writers; some days the campaign trail itself feels like a sketch on the show, he said.

“The show has acquitted itself well,” Miller said.