A federal judge says the structure of the Consumer Financial Protection Bureau is unconstitutional.

U.S. District Judge Loretta Preska in Manhattan objected to the CFPB's setup as an independent agency with a single director who can be fired by the president only for cause, not at will.

In January, a federal appeals court in Washington said that structure is legal. Preska said she disagreed.

The immediate effect of the ruling appears to be limited. It means the CFPB can't be party to a lawsuit about a company accused of scamming 9/11 first responders. The New York attorney general, who was also a plaintiff, can move forward with the case.

But the judge's decision adds fodder to the political fight over the independence of the CFPB, which was established after the financial crisis to safeguard Americans against predatory financial institutions.

The CFPB declined to comment.

The American Bankers Association, which has advocated for reining in the CFPB, said the implications of the decision "remain unclear," because other federal courts have ruled differently.

The Center for Responsible Lending, a consumer advocate group, said it was a "clear and completely inappropriate example of legislating from the bench."

Related: CFPB effectively dissolves Consumer Advisory Board

The CFPB is a frequent target of Republicans, who argue it wields too much unchecked power.

Acting Director Mick Mulvaney, who called the CFPB a "joke" when he was serving in the House, has taken steps to weaken the bureau since his appointment in November.

Earlier this month, he essentially disbanded a board of advocates who advised the agency about fair lending and underserved communities.

President Donald Trump named Kathy Kraninger, who currently works at the Office of Management and Budget, this week as Mulvaney's permanent replacement.

Democrats including Senator Elizabeth Warren of Massachusetts oppose her appointment. Warren tweeted Tuesday that Kraninger "has no track record of helping consumers."

Mulvaney said Wednesday at a financial technology conference in New York that the CFPB is "still Elizabeth Warren's baby."

"Until we break that, we'll never be considered to be on par with other regulators like the SEC," he said.

--CNNMoney's Anna Bahney contributed to this report.