SAN JUAN, Puerto Rico (AP) — Congress has given final passage to legislation that would shut down legal cockfights in U.S. territories including Puerto Rico and the U.S. Virgin Islands, ending an institution dating from the colonial era that generates millions of dollars each year.

Opponents of the measure approved Wednesday by the House say it will have a devastating effect on the islands' economies, noting that in Puerto Rico alone the cockfighting industry generates some $18 million a year and employs more than 20,000 people.

Puerto Rico Gov. Ricardo Rossello traveled to Washington to demand that the island be excluded, but he arrived too late. Legislators unexpectedly moved up the vote and approved the bill, which already passed the Senate.

Supporters of the measure say it is long overdue and will help protect animals.