WASHINGTON (AP) — The Supreme Court will consider whether an advertising agency hired to boost recruitment for the U.S. Navy is immune from a lawsuit that claims it illegally authorized thousands of unsolicited text messages.

The justices said Monday they will hear an appeal from the Campbell-Ewald Company, which claims federal contractors can't be sued under the Telephone Consumer Protection Act.

The agency sent the messages through a subcontractor to thousands of cell phones, including one belonging to Jose Gomez. Gomez says he never consented to receiving the texts and filed a class-action lawsuit.

A federal appeals court rejected the company's claim that government contractors are immune from such lawsuits. The company also argues that Gomez can't pursue a class action because he refused an offer to settle the case.