WASHINGTON (AP) — Consumer groups are praising the Supreme Court’s rejection of a conservative-led attack that could’ve undermined the Consumer Financial Protection Bureau.

The justices ruled Thursday the way the bureau is funded does not violate the Constitution.

Payday lenders had objected to a bureau rule limiting their ability to withdraw funds directly from borrowers’ bank accounts.

A bureau spokesman says the court “repudiated the arguments of the payday loan lobby” and made clear the bureau is here to stay.

The bureau was the brainchild of Democratic Sen. Elizabeth Warren of Massachusetts and was created after the 2008 financial crisis to regulate consumer finance including mortgages and car loans.

Republicans and their financial backers oppose it.