The Supreme Court on Thursday rejected a conservative-led attack that could have undermined the Consumer Financial Protection Bureau.

The justices ruled 7-2 that the way the agency is funded does not violate the Constitution, reversing a lower court. The CFPB was created after the 2008 financial crisis to regulate mortgages, car loans and other consumer finance.