Sen. Lindsey Graham on Thursday rebuked President Trump’s assertion that he’d welcome dirt about his political foes from foreign governments — the first GOP lawmaker to criticize the commander-in-chief over the stunning comments.

“I think it’s a mistake. I think it’s a mistake of law. I don’t want to send a signal to encourage this,” Graham, usually a reliable supporter of the president, told reporters at the Capitol.

Trump also suggested in an interview with ABC News Wednesday night that members of Congress routinely accept what he called “oppo research” from foreign sources.

“I can only speak for myself. I’ve never had a government come up to me and say, ‘Hey, I’d like to help you in your campaign.’ The answer is no. It’s got to be no. I mean, the likelihood of foreign interference is growing, not lessening,” the South Carolina senator continued.

He also cited Donald Trump Jr.’s sitdown with Kremlin-connected Russians in Trump Tower in June 2016 — and called it a mistake.

“And again, you know, you’ve got a situation in 2016 that, you know, Don Jr. sat down and talked with somebody, representing themselves, to have information” about Hillary Clinton, he said.

“And that was a mistake, apparently they didn’t act on it. It’s not a crime to have a meeting. It’s a crime to receive the information, and apparently that didn’t happen.”

Graham then turned to the administration’s determination to investigate US law enforcement agencies and Clinton staffers for supposed wrongdoing during the campaign.

Attorney General William Barr at Trump’s direction is leading the probe, which Democrats have called a diversion from Trump’s own alleged malfeasance.

“I hope my Democrat colleagues will be equally offended by the fact that this actually did happen in 2016 where a foreign agent was paid for by a political party to gather opposition research. All those things are wrong,” he said, referring to Christopher Steele and the dossier of salacious but unverified allegations against Trump he contributed to that was paid for by Democrats.

“I want to look at all of it. And I want us to come out of the 2016 election with some real bright lines that no party should be hiring foreign agents to look at their opponents. And we shouldn’t be taking meetings,” he said.

Trump’s statements to ABC — in which he also said FBI chief Christopher Wray was “wrong” to say that politicians contacted by foreign governments should call the feds — caused a firestorm of criticism and pumped new life into Democrats calls for impeachment proceedings.

But the president remained defiant on Thursday, defending himself in a morning tweetstorm.

“I meet and talk to ‘foreign governments’ every day. I just met with the Queen of England (U.K.), the Prince of Whales [sic], the P.M. of the United Kingdom, the P.M. of Ireland, the President of France and the President of Poland. We talked about ‘Everything!’” he tweeted, before correcting his spelling of “Wales” in an updated post.

“Should I immediately call the FBI about these calls and meetings? How ridiculous! I would never be trusted again. With that being said, my full answer is rarely played by the Fake News Media. They purposely leave out the part that matters,” the president said.