The feds are looking into possible campaign finance misdeeds by Rep. Alexandria Ocasio-Cortez’s chief of staff and lead rainmaker, who suddenly resigned Friday, federal sources told The Post.

The inquiry centers on two political action committees founded by Saikat Chakrabarti, the top aide who quit along with Ocasio-Cortez spokesman Corbin Trent, the sources said. Trent left to join the congresswoman’s 2020 re-election campaign.

The brash Chakrabarti, who masterminded Ocasio-Cortez’s campaign and steered her proposed Green New Deal, had caused uproar in the halls of Congress with a series of combative tweets that contributed to a rift between his rookie boss and House Speaker Nancy Pelosi.

“People were not happy that he used his Twitter account to comment about members and the bills that he and his boss oppose,” a senior House Democratic staffer said. “There was a series of colliding and cascading grievances.”

The two PACs being probed, Brand New Congress and Justice Democrats, were both set up by Chakrabarti to support progressive candidates across the country.

But they funneled more than $1 million in political donations into two private companies that Chakrabarti also incorporated and controlled, according to Federal Election Commission filings and a complaint filed in March with the regulatory agency.

In 2016 and 2017, the PACs raised about $3.3 million, mostly from small donors. A third of the cash was transferred to two private companies whose names are similar to one of the PACs — Brand New Congress LLC and Brand New Campaign LLC — federal campaign filings show.

While PACs must follow stringent federal rules on disclosure of spending and fundraising, private companies are not subject to the same transparency.

The complaint filed by the National Legal and Policy Center, a government watchdog group based in Virginia, alleged that the LLCs appeared to have been set up to obscure those federal reporting requirements.

In March, when the FEC complaints were filed, a lawyer for the PACs, the LLCs and the Ocasio-Cortez campaign told the Washington Post that the arrangement “fully complied with the law and the highest ethical standards” and that Chakrabarti never profited from any of the political entities he formed.

They may also have violated the $5,000 limit on contributions from federal PACs to candidates, according to the complaint. It is not known if any of that money flowed to Ocasio-Cortez’s campaign.

Federal authorities are looking at new salary rules imposed by Ocasio-Cortez when she took office earlier this year, and whether they were put in place to let Chakrabarti dodge public financial disclosure rules, according to sources.

Although Ocasio-Cortez raised the salaries of junior staffers in her office to just over $52,000 a year, Chakrabarti took a massive pay cut. The Harvard graduate and tech millionaire agreed to an annual salary of $80,000 — far less than the $146,830 average pay for his position.

Because his salary was less than $126,000, congressional rules exempted the chief of staff from having to disclose his outside income.

The legal quagmire comes on the heels of Chakrabarti’s attacks on fellow Democrats.

In June and July, Chakrabarti accused Pelosi of being a weak leader and said that moderate Democrats were racists, “hell-bent to do to black and brown people today what the old Southern Democrats did in the 40s.”

“Pelosi claims we can’t focus on impeachment because it’s a distraction from kitchen table issues,” he posted July 6. “What is this legislative mastermind doing?”

Four days later, Pelosi reprimanded Ocasio-Cortez and her “Squad” of young progressives during a closed-door meeting, demanding they stop airing their grievances in public.

“So, again, you got a complaint? You come and talk to me about it,” Pelosi admonished, according to Politico.

But the next week, President Trump kicked up the controversy again with a series of Dem-needling tweets. That led to a July 26 clear-the-air meeting between Pelosi and Ocasio-Cortez, one week before Chakrabarti’s departure to join a nonprofit think tank, New Consensus.

AOC did not show up at a Bronx event on her schedule Saturday. Her office would not comment on the staff departures, and Chakrabarti did not return several messages. Trent declined comment.

Additional reporting by Ben Cohn