A federal appeals court has revived a proposed class action lawsuit against Facebook Inc. brought on behalf of non-Facebook users who claim they've gotten unsolicited texts from the company in violation of a federal robocalling statute.

The U.S. Court of Appeals for the Ninth Circuit reversed a lower court decision that had tossed a lawsuit brought by Noah Duguid, a non-Facebook user who claimed the company violated the Telephone Consumer Protection Act (TCPA) by mistakenly sending him security messages meant to alert users when their account had been accessed from an unrecognized device or browser. Duguid claimed that Facebook failed to respond to his multiple text and email requests to stop sending him the texts.

“The messages Duguid received were automated, unsolicited, and unwanted,” wrote Judge M. Margaret McKeown, adding that the messages fell outside an exemption to TCPA liability for emergency messages that has been outlined by the Federal Communications Commission. “Duguid did not have a Facebook account, so his account could not have faced a security issue, and Facebook's messages fall outside even the broad construction the FCC has afforded the emergency exception,” McKeown wrote.

The court, however, joined with the Fourth Circuit in finding that an exemption for calls “made solely to collect a debt owed to or guaranteed by the United States” added to the TCPA by Congress in a 2015 amendment violated the First Amendment. But also like the Fourth Circuit, the court found that the federal debt collection exemption was severable from the TCPA, refusing a request from Facebook and its lawyers at Latham & Watkins to find the entire statute unconstitutional.

Facebook representatives didn't immediately respond to a request for comment Thursday. The company and its lawyers have argued that the statute, which has statutory penalties of $500 per violation and was initially aimed at curbing unwanted calls from telemarketers, was never meant to put companies in Facebook's position on the hook potentially for millions in liability.

Duguid's lawyer, Sergei Lemberg of Wilton, Connecticut-based Lemberg Law, said that Facebook has indicated that there are a significant number of people who, like his client, received unwanted texts.

“What's important is the message: Man versus machine. Man wins. Privacy matters,” Lemberg said. “I think Facebook for years and years was pretty cavalier, to say the least, about individuals' privacy and this case is different from some of the stuff that's out there publicly, but it's cut from the same cloth.”

Lawyers from the U.S. Department of Justice intervened in the case to defend the constitutionality of the statute, but took no position on whether Facebook violated the TCPA. The Chamber of Commerce, represented by counsel from Jones Day, filed an amicus brief asking the Ninth Circuit to invalidate the restriction on using an automatic telephone dialing system to call cellphones.