A federal judge ruled Thursday that the consumer finance regulator stepped “well outside” its authority, and stopped it from pursuing an investigation of an organization that accredits for-profit colleges.

The decision marks the first time a court has found that the Consumer Financial Protection Bureau, which has been under intensifying political and legal challenges, exceeded its bounds.

“What makes this rebuke even more important is that it arises in a situation where courts almost invariably give federal agencies a lot of leeway—namely, issuing a civil investigative demand,” said Alan Kaplinsky, who heads the consumer financial services group at the Ballard Spahr law firm.