SAN JUAN, Puerto Rico — Puerto Rico defied the U.S. government by adopting a law on Wednesday to keep cockfighting alive, seeking to protect a 400-year-old tradition on the island despite a federal ban that goes into effect this week.

Those in the cockfighting business cautiously rejoiced amid concerns over the U.S. territory trying to sidestep a federal law that President Donald Trump signed a year ago.

“We are certainly challenging a federal law. We know what that implies,” Rep. Gabriel Rodríguez Aguiló, who co-authored the bill, told The Associated Press late Tuesday before the announcement was made public.

Rodríguez said he expected the fight to end up in federal court.

As word spread, those in the cockfighting industry cheered the news as some met with Gov. Wanda Vázquez, who announced Monday that she plans to run in the island’s 2020 general elections.

“There’s going to be work!” exclaimed Domingo Ruiz, who owns more than 30 cocks and has spent more than half a century in the business. “We’re going to keep the fight alive.”

Cockfighting generates an estimated $18 million a year and employs some 27,000 people, according to the bill approved by Puerto Rico’s House and Senate. The island’s legislators had bristled at Trump’s move, noting in their bill that cockfights and betting on them have been “part of our culture and folklore ever since their introduction to Puerto Rico in the 17th century.”

Puerto Rico has 71 cockfighting establishments in 45 municipalities licensed by the island’s Department of Sports and Recreation, said Secretary Adriana Sánchez. She defended the cockfighting tradition and contended the U.S. government banned fights for economic and not animal welfare reasons.

Sánchez said a ban would just drive the fights underground on an island mired in a 13-year recession and still struggling to recover from Hurricane Maria.

“It’s very hard for someone to find a Plan B from one moment to the next that would allow them to make a living through something that is not cockfighting,” she said.

Animal rights activists have long pushed to end cockfights in U.S. territories, saying they are cruel and noting they are illegal in all 50 U.S. states.

Wayne Pacelle, founder of the Washington- based Animal Wellness Action, said he doesn’t believe the statistics on Puerto Rico cockfighting.

“They are widely exaggerating the economic value,” he said. “Watching animals slash each other just for human entertainment and gambling is not judged as a legitimate enterprise by mainstream people.”

The measure says it is legal for Puerto Rico to host cockfights as long as people don’t export or import cocks or any goods or services related to cockfighting. The latter actions would violate the federal law, based on how Puerto Rico officials interpret it.

“It remains to be seen whether that’s how federal authorities understand it,” said Rep. Luis Vega Ramos.

Vega sought unsuccessfully to amend the measure to add authorization for local officials to not cooperate with federal agents in prosecuting people for cockfighting. But several municipalities, including the capital of San Juan, have authorized municipal police not to crack down on cockfighting.

Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.