President Trump jumped into the festering feud between Alexandria Ocasio-Cortez and Nancy Pelosi on Friday — scolding the freshman New York lawmaker for being “disrespectful” to the House speaker.

“I think Cortez, who kept Amazon out of New York and they don’t like her for that, thousands and thousands of jobs, I think Cortez is being very disrespectful to somebody that’s been there a long time,” Trump said, referring to Pelosi, whom the president had dubbed “Nervous Nancy.”

Speaking outside the White House before a trip to Wisconsin, the president then praised the veteran California Democrat, whom he also recently called “a disgrace” after she reportedly said she wanted to see him in prison, not impeached.

“I deal with Nancy Pelosi a lot and we go back and forth and it’s fine, but I think that a group of people is being very disrespectful to her. And you know what? I don’t think that Nancy can let that go on,” he said before criticizing AOC and Michigan Rep. Rashida Tlaib, Minnesota Rep. Ilhan Omar and Massachusetts Rep. Ayanna Pressley.

“A group of people that came — I don’t know where they came from. I’m looking at this Omar from Minnesota, and if one-half of the things they’re saying about her are true, she shouldn’t even be in office, she should not be doing what she’s doing,” Trump said.

The president then ripped AOC for questioning whether she and the others were being singled out because they are women and minorities.

“I’ll tell you something about Nancy Pelosi that you know better than I do. She is not a racist, okay? She is not a racist. For them to call her a racist is a disgrace,” he said.

And the commander-in-chief also slammed Ocasio-Cortez for her assertion that migrant women in a detention center she visited had been told by guards to drink from the toilet after their sink broke.

“To have Ocasio-Cortez say they’re drinking out of toilets, she made that up. That’s a phony story. She made it up,” Trump said, adding that he would visit a center himself but wasn’t sure when because of campaign commitments.

“We’re taking a tour. I would love to be there [soon], but we’re going to Ohio, Wisconsin. I’ll be going,” he said before adding that he knew what the conditions were like, and that Border Patrol agents “love” the detainees and take great care of them.

“I’ve seen it. I’ve seen it, and these centers are — I mean, and these people, I’ll tell you what, I’ve been with ICE and I’ve been with Border Patrol a lot. They love those people coming across the border. They love them, and I’ve seen it. They love them,” Trump said.

Pelosi on Wednesday told the four freshman firebrands to lay off criticizing other Dems on social media after an AOC staffer posted a since-deleted tweet attacking moderate Dems as modern-day segregationists.

The president, meanwhile, went after another of his hometown’s pols — attacking Mayor Bill de Blasio for the Big Apple’s sanctuary city status and for Hizzoner’s opposition to Sunday’s ICE raids.

“The mayors in sanctuary cities like de Blasio [who] is probably the worst mayor in the country. I don’t know what his attitude is. Nobody does, because he doesn’t work very hard. Nobody knows what he does,” Trump riffed.

“But a guy like de Blasio probably wouldn’t want the raid,” he said, adding that “many mayors do. Most do. You know why? They don’t want to have crime in their cities or states.”

Coincidentally, the mayor at around the same time had a few choice words for Trump and the planned ICE raids during his weekly appearance on WNYC.

“The first thing to say is this is a disgusting, cynical policy, this is President Trump, absolutely a political agenda, he’s simply trying to convince working-class and middle-class American citizens that immigrants are the cause of all their economic woes and misery,” de Blasio said.

He also questioned whether the raids, touted by Trump but postponed before, would actually happen.

“We don’t know if this claimed raid is real or not, we don’t know when, how, we can’t trust anything the Trump administration says,” he said.

“I believe in the rule of law absolutely, but we have a lawless president and we can’t trust a word he says. He has turned ICE into a political operation.”