A federal district judge on Thursday dismissed a lawsuit brought by the Consumer Financial Protection Bureau against the embattled accreditor of for-profit colleges, saying the agency lacked the authority to investigate.

"It's really the first time a court has determined that the CFPB lacked jurisdiction," said Alan Kaplinsky, a partner and leader of the consumer financial services group at the law firm Ballard Spahr. "Hardly ever does a court tell a federal agency that a [civil investigative demand] is invalid. To get rebuked as sharply as they did was a surprise."