Bill O’Reilly said voters are angry at Republican lawmakers who essentially killed immigration reform over their stubborn insistence on punishing so-called “sanctuary cities” — which was basically his own idea.

The Fox News host appeared Monday night on “The Late Show With Stephen Colbert,” where the host pressed O’Reilly to explain the appeal of his friend, Donald Trump.

ADVERTISEMENT

“If you know the guy, does it comfort you — like, since you know the guy personally and, if you’ve known him for years — does it comfort you to think that this is going to be one of the two major-party candidates?” Colbert asked. “Because that’s a reasonable shot at being president.”

O’Reilly said he wasn’t “arrogant enough” to say whether any individual candidate was qualified to serve as president — but he said voters were clear in their preference.

“The people in the Republican Party want Donald Trump for one reason: They want to blow the whole establishment up,” O’Reilly said. “That’s why he’s gotten where he’s gotten.”

Colbert asked why the GOP establishment was so opposed to Trump.

“Well, they don’t want their party blown up, Colbert,” O’Reilly countered, drawing laughs. “They like it the way it is. If you’re going to blow it up, they don’t like that.”

ADVERTISEMENT

O’Reilly said conservative voters were angry that progressives — or Colbert’s “crew,” the Fox host pointed out — seemed to be winning the culture war, and the “Late Night” host pulled out a pen and paper and started taking notes.

“I am the problem,” Colbert said, jotting a note out loud as O’Reilly spoke.

O’Reilly said conservatives felt the culture was changing to match progressive values, and Colbert’s audience cheered.

ADVERTISEMENT

“I don’t think there’s anything wrong with being conservative, per se, but it is always a losing battle — because the culture always changes,” Colbert said. “We don’t speak Middle English anymore.”

O’Reilly joked that Comedy Central would never have allowed Colbert to say there’s nothing wrong with conservatism, but he said GOP voters were angry for a very specific reason.

ADVERTISEMENT

“They don’t like what the country is becoming,” O’Reilly said, referring specifically to the fatal shooting of Kate Steinle by a Mexican man who had been repeatedly deported for immigration and felony violations.

He called for “Kate’s Law,” which would mandate 5- or 10-year federal prison terms for aggravated felons who are in the U.S. illegally — but he complained the bill couldn’t be passed over Republican objections.

“It’s all (bullshit) and the folks know it,” O’Reilly said. “The anti-illegal alien stuff is (bullshit), because you shouldn’t be anti-illegal aliens — that doesn’t solve any problems.”

ADVERTISEMENT

Colbert agreed, saying crime should be the focus — and the two men acted horrified to find so much common ground.

“You’re actually listening, and that’s a good thing,” O’Reilly said.

He said Republican lawmakers refused to pass Kate’s Law unless it was attached to a “sanctuary cities” bill they knew Obama would veto — and Colbert asked why they would do that.

“That’s right,” O’Reilly thundered. “Why would they do that? I ask — I’m pounding the table, put it as a standalone. President Obama would sign Kate’s Law, I believe. He wouldn’t veto it, but you can’t attach it to 15 other things.”

ADVERTISEMENT

O’Reilly pushed for Kate’s Law immediately following the 32-year-old Steinle’s slaying — but the Fox News host also repeatedly used his nightly prime time program to promote federal sanctions against San Francisco and other “sanctuary cities.”

Just five days after Steinle’s homicide, O’Reilly urged Congress to “crack down” on cities whose local laws don’t match federal immigration laws, and he continued pressing GOP lawmakers to punish local officials and take away their federal funding.

“The word mandatory is crucial,” O’Reilly said. “There are laws on the books now that are being ignored. Congress must write Kate’s Law so if officials do not enforce the mandatory sentence, they themselves can be prosecuted.”

“Congress must act on illegal immigration,” O’Reilly added at the time. “This sanctuary city business has got to end.”

ADVERTISEMENT

He eventually turned on Republican lawmakers who insisted on tying Kate’s Law to the Sanctuary Cities Act — but O’Reilly played a key role in stirring up GOP outrage against the myth of sanctuary cities.

Colbert started to ask another question, but O’Reilly cut him off and insisted the host listen to him a bit more.

“Oh, boy,” Colbert said, in mock exasperation. “I’ve been listening, I’ve been very good.”

O’Reilly told the host to absorb his lessons, and then live them.

“I have to live it?” Colbert said. “I have to live this when it’s over? Oh.”

ADVERTISEMENT

O’Reilly said Republican voters see their own party leadership blocking basic reform of immigration laws.

“They expect Harry Reid to do it — he’s corrupt,” O’Reilly said. “But they don’t expect their leadership to not do anything. That’s why they’re furious.”

Colbert said Trump was tapping into voter anger about other issues, as well, but O’Reilly said he didn’t want to get too complicated for his host.

“Hold on a second, let me see if I understand you,” Colbert said, pulling a marker from his desk and inhaling the fumes. “Go quickly, go quickly before it wears off.”

ADVERTISEMENT

Watch the entire segment posted online by The Late Show with Stephen Colbert: