A federal judge is ordering Starbucks to reinstate seven employees in Memphis who were fired earlier this year after leading an effort to unionize their store.

In a decision issued Thursday, U.S. District Judge Sheryl Lipman agreed with the National Labor Relations Board, which had asked the court to intervene in May. The labor board said Starbucks violated U.S. labor law by interfering in workers’ right to organize.

Lipman’s decision requires Starbucks to offer to reinstate the employees within five days. Starbucks will also be required to post the court order in the Memphis store.

Starbucks said Thursday it strongly disagrees with the court order and will appeal. It will also request a stay of the opinion, which would delay the reinstatement of the employees while the appeal is considered.

The case has been among the most closely watched in the unionization effort at Starbucks. Since late last year, more than 220 U.S. Starbucks stores — including the Memphis store — have voted to unionize. Starbucks opposes the unionization effort.

“Today’s federal court decision ordering Starbucks to reinstate the seven unlawfully fired Starbucks workers in Memphis is a crucial step in ensuring that these workers, and all Starbucks workers, can freely exercise their right to join together to improve their working conditions and form a union,” the labor board’s General Counsel Jennifer Abruzzo said in a statement. “Starbucks, and other employers, should take note that the NLRB will continue to vigorously protect workers’ right to organize without interference from their employer.”

One of the workers, Beto Sanchez, said he and his colleagues have suffered financial distress since they were fired, and he has had to work several jobs. Sanchez said he was so surprised after receiving a text about the favorable ruling that he dropped his phone.

“We’ve had a lot of tough moments, but we kept fighting each day,” Sanchez said. “It feels like all the hard work has paid off during all those months, and we’re just really happy.”

The NLRB has filed a separate federal court case in New York seeking the reinstatement of seven pro-union workers who were fired from a store in Buffalo. A decision in that case is pending.

The agency lost a similar case in Arizona in June, when a federal judge declined to order Starbucks to reinstate three workers.