Foxhounds belonging to John Bassler are seen in an enclosure on his property that includes the Piney Run Foxhound Training Preserve on Aug. 6, 2013, in Milford, Va. (Matt McClain/The Washington Post)

A controversial Virginia practice known as fox penning, in which wild-caught foxes are held captive in fenced enclosures and chased by packs of dogs, will soon be a part of the commonwealth’s past.

Virginia Gov. Terry McAuliffe (D) signed a bill Friday that will restrict and ultimately phase out state-licensed foxhound training preserves, enclosed properties where the foxes are used as game in foxhound training exercises and staged competitions.

Virginia is home to 36 licensed training preserves, primarily in the southern part of the state. Those businesses will be allowed to operate for up to 40 years, with a statewide moratorium on the practice slated for July 1, 2054, according to the bill introduced by Sen. David W. Marsden (D-Fairfax).

The bill also limits the number of foxes stocked in pens to a maximum of 900 a year. According to the Department of Game and Inland Fisheries, more than 5,800 foxes have been delivered to Virginia pens over the past five years.

Supporters of foxhound training preserves say the properties are a valued part of Virginia’s hunting tradition, offering an effective and humane way to train hunting dogs and hold sporting events. Several other states in the South allow the practice of trapping and penning wild foxes.

But opponents say that fox penning is a cruel practice akin to dogfighting, often resulting in fox deaths. In a 2004 study by the state game department and Virginia Tech researchers, half of 56 foxes at one of the largest foxhound training preserves were killed by hounds, and only 10 percent survived the 18-month study period.

Kirby Burch, vice chairman and lobbyist for the Virginia Hunting Dog Alliance, said that the hunting and pen-operating community had little choice but to agree to the terms of the legislation.

“The attorney general and the governor made it very clear that they were going to close them down if they didn’t agree to their terms,” Burch said. “It’s not a compromise — it’s extortion. But that’s the way of life sometimes, and hopefully everybody will live up to their sides of the agreement.”

He added that there is also concern about the eventual disappearance of the practice, which has been a part of the state’s culture since the 1980s.

“Hope springs eternal that over time, people may be educated enough to understand that it isn’t animal fighting and it isn’t inhumane, and that we might be able to keep [the foxhound preserves]. And I think that’s in the back of a lot of pen operators’ and hunters’ minds,” Burch said. “But I realize that urban America doesn’t understand rural America.”

Laura Donahue, Virginia director of the Humane Society of the United States, said the passage of the bill was ultimately a reflection of Virginia’s rapidly evolving culture, which has exhibited less tolerance for animal cruelty.

“Our goal has always been just to spread the word, and the more people learned, the more they were shocked and appalled,” she said. “I didn’t know when we were going to triumph, but I knew it was a matter of ‘when’ and not ‘if.’ ”

Efforts to ban foxhound training preserves have been making gradual progress in recent years, she said. Last year, a similar bill passed the state Senate before failing in the House, and the state game department approved heightened regulations governing the operation of the preserves.

Marsden, who has led the effort to pass legislation banning fox penning, said he hopes the new law will set a powerful precedent.

“Now we have a bill that for the first time . . . declares this sport to be illegal,” he said. “I think this will have a great impact, not only by reducing the involvement in this sport in Virginia, but around the country. . . . Eventually, this sport will run out of folks who are willing to do it.”