A Democratic Party civil war is brewing — and Rep. Alexandria Ocasio-Cortez is smack in the middle of it.

The hard-left freshman congresswoman threw fuel on the fire this week by threatening to put Democratic moderates who vote alongside Republicans “on a list” and run them out of office in the 2020 primaries.

The power play came during a closed-door meeting with Speaker Nancy Pelosi on Thursday, a day after the House passed a gun-control bill that would broaden federal background checks for sales at gun shows and on the Internet.

“She said that when activists ask her why she had to vote for a gun-safety bill that also further empowers an agency that forcibly injects kids with psychotropic drugs, they’re going to want a list of names and she’s going to give it to them,” Ocasio-Cortez’s spokesman, Corbin Trent, told The Washington Post, referring to US Immigration and Customs Enforcement.

The bill was passed 240-190 but came with a caveat: an amendment that was tacked on last minute that will require ICE be notified when an illegal immigrant tries to buy a gun.

That provision was backed by 26 moderate Democrats, infuriating Ocasio-Cortez, who told her colleagues they’re “putting themselves on a list.”

The snipe rankled fellow Democrats.

“It certainly is frustrating when you have members of your own caucus issuing threats,” said one moderate Democratic lawmaker who voted with Republicans on the ICE provision and who wished to remain anonymous, “but I don’t take them very seriously and I’m going to do what I think is in the best interest of the constituents I represent.”

The legislator said Ocasio-Cortez’s remarks are proof of her inexperience on Capitol Hill.

“I think that’s wrong and shows a lack of understanding for moderate-leaning districts,” he continued. “The belief is that some of the members on the more progressive side of the caucus don’t really understand what it’s like to represent a moderate district. Our districts don’t look like theirs and if we’re going to keep the majority, we have to protect these moderate seats and it would be in everyone’s best interest if we all worked together.”

In the private meeting, Pelosi urged unity within the party.

“We are either a team or we’re not, and we have to make that decision,” she said, according to the Washington Post.

It’s not the first time Ocasio-Cortez has waged war against her own party. In a video released in January by Justice Democrats — who helped her beat Rep. Joe Crowley — she called on progressives to run for office and unseat moderates.

The Democratic lawmaker who voted with Republicans on the ICE provision pushed back further against Ocasio-Cortez.

“People can threaten me and I get threats everyday from my left and right,” he said. “But I’m going to do what I think is in the best interest of the people in the district that I represent regardless of the petty politics that other people want to play.”

On Friday, Ocasio-Cortez tried to walk back her spokesman’s comments about the so-called hit “list.”

“I didn’t say that they were putting themselves on a list for primaries,” she tweeted. “I said that by Dems distinguishing themselves by breaking off on procedural MTR votes, they were inadvertently making a list of targets for the GOP and for progressive advocates on their pro-ICE vote.”

She added in a follow-up post, “It’s not all about elections, though much of it can be. It’s also about slowly creeping member positions to be more conservative, trade off communities of color, or weaken important legislation — no matter your party.”

Meanwhile, the Democratic aide told The Post that Ocasio-Cortez and her staff are impossible to work with — even before Thursday’s meeting.

“I think she has shown that she doesn’t understand how to get things done as it relates to legislation, as it relates to building relationships with other offices,” that aide said.

“She came here showing she wanted to burn the House down, which shows she’s incredibly stupid, incredibly arrogant, or both.”

Trent, the congresswoman’s spokesman, took critics to task for not speaking on the record.

“One thing that is different about this office is when we say things, we say them . . . with our names attached to them,” he said.

He added that Ocasio-Cortez and her staff wouldn’t “change a thing” on how they’ve navigated the Hill thus far because they’ve gotten “pretty decent results.”

“Now, do I hope things evolve and we’re able to build relationships and work with folks going forward? Absolutely,” he said.