NEW YORK (AP) — A federal judge has ordered Amazon to stop retaliating against employees engaged in workplace activism. U.S. District Judge Diane Gujarati issued a mixed ruling that also hands a loss to the federal labor agency that sued the company earlier this year.

The ruling came in a court case brought by the National Labor Relations Board (NLRB), which sued Amazon in March seeking the reinstatement of a fired employee who was involved in organizing a company warehouse in Staten Island. In its lawsuit, the agency argued that Amazon’s termination of the former employee, Gerald Bryson, was unlawful and would have a chilling effect on organizing.

The suit argued that not reinstating Bryson would make workers think that the NLRB could not protect their labor rights under federal law. On Friday, Gujarati ruled that there was “reasonable cause” to believe the e-commerce giant committed an unfair labor practice by firing Bryson. She issued a cease-and-desist order directing the Seattle-based company to not retaliate against employees involved in workplace activism.

But Gujarati denied the NLRB’s request to reinstate Bryson. She determined that the agency did not present evidence that Bryson’s termination is having a considerable effect on organizing efforts by employees or the Amazon Labor Union, the nascent group in connection to Bryson that ultimately pulled off the first-ever labor win at an Amazon warehouse in the U.S. in March.

In her ruling, Gujarati also noted that Bryson was fired before the union was formed, which makes it different from other cases where a slowdown of organizing support was shown after the firing of a union activist. Bryson was fired in April 2020, weeks after participating in a protest over working conditions during the early days of the COVID pandemic.

While off the job during a second protest, Bryson got into a dispute with another employee. Amazon did its own investigation into the dispute, citing a violation of its vulgar-language policy to terminate Bryson. The company denies that the firing was connected to organizing activities.

Shortly after Bryson was fired, he filed a complaint with the NLRB. An administrative law judge concluded earlier this year the company pursued a “skewed investigation” into the dispute designed to blame Bryson. Amazon has said it would appeal that ruling in the NLRB’s own administrative process. Friday’s court ruling came from a separate federal case filed by the agency, which doesn’t have enforcement powers.

On Friday, Gujarati ordered Amazon to post English and Spanish copies of the court order at the Staten Island facility that voted to unionize. She also ordered the company to distribute electronic copies to employees and hold a mandatory meeting where the order can be read aloud.