President Trump Donald John TrumpSteele Dossier sub-source was subject of FBI counterintelligence probe Pelosi slams Trump executive order on pre-existing conditions: It 'isn't worth the paper it's signed on' Trump 'no longer angry' at Romney because of Supreme Court stance MORE on Wednesday said he is "very happy" that some GOP senators from earlier in his term are no longer in the Senate, telling a group of supporters that those lawmakers have "gone on to greener pastures."

Trump went on a riff during a campaign-style speech to the Faith and Freedom Coalition in which he complained about Democrats blocking his desired immigration policies before acknowledging he was unable to pass his agenda when Republicans held both chambers of Congress.

ADVERTISEMENT

"But we didn’t have enough votes because it was very close. We needed 60 votes, and we had 51 votes, and sometimes, you know, we had a little hard time with a couple of them, right?" Trump said, referring to the GOP Senate majority during the previous Congress.

"Fortunately, they’re gone now. They’ve gone on to greener pastures — or perhaps far less green pastures, but they’re gone," he said, without naming any senators. "I’m very happy they’re gone."

White House deputy press secretary Hogan Gidley later told reporters aboard Air Force One en route to Japan that the comment was directed at former Sens. Bob Corker Robert (Bob) Phillips CorkerHas Congress captured Russia policy? Tennessee primary battle turns nasty for Republicans Cheney clashes with Trump MORE (R-Tenn.) and Jeff Flake Jeffrey (Jeff) Lane FlakeHow fast population growth made Arizona a swing state Jeff Flake: Republicans 'should hold the same position' on SCOTUS vacancy as 2016 Republican former Michigan governor says he's voting for Biden MORE (R-Ariz.), who were outspoken critics of the president during the last Congress.

"There’s been some confusion over who the president was talking about this morning when he mentioned some senator, senators who’ve passed on to greener pastures, or not so greener pastures," Gidley said. "Some people in the media are speculating he was talking about Senator McCain. That’s absolutely ridiculous. He was talking specifically about Senators Corker and Flake."

Earlier in his remarks, he alluded to the late Sen. John McCain John Sidney McCainAnalysis: Biden victory, Democratic sweep would bring biggest boost to economy The Memo: Trump's strengths complicate election picture Mark Kelly: Arizona Senate race winner should be sworn in 'promptly' MORE's (R-Ariz.) 2017 vote against what was known as a skinny repeal of the 2010 Affordable Care Act.

"I’m keeping ObamaCare alive because I felt I should do that," Trump said. "We had a chance to terminate it, and a gentleman voted against it after campaigning for many years to repeal and replace. Then he voted against repeal and replace. Someday somebody will explain that to me."

GOP Sens. Susan Collins Susan Margaret CollinsThe Hill's Campaign Report: Trump faces backlash after not committing to peaceful transition of power Billionaire who donated to Trump in 2016 donates to Biden Credit union group to spend million on Senate, House races MORE (Maine) and Lisa Murkowski Lisa Ann MurkowskiOVERNIGHT ENERGY: House passes sweeping clean energy bill | Pebble Mine CEO resigns over secretly recorded comments about government officials | Corporations roll out climate goals amid growing pressure to deliver The Hill's Morning Report - Sponsored by Facebook - Trump previews SCOTUS nominee as 'totally brilliant' Abortion stirs GOP tensions in Supreme Court fight MORE (Alaska) also voted against the skinny repeal. Both are still serving in the Senate.

Trump has regularly gone after McCain, who died of brain cancer almost a year ago. The president often brings up McCain's ObamaCare vote. He also has accused McCain of being bad for veterans and complained that he was not properly thanked for approving some arrangements for McCain's funeral.

Corker and Flake often took issue with the president's rhetoric, earning his ire over Twitter. Both men voted in favor of the skinny repeal of Obamacare, and regularly voted along party lines.

Both Corker and Flake opted not to run for reelection in 2018.

Updated at 8:58 p.m.