WARSAW, Poland (AP) — Poland’s president has signed into law legislation that is intended to contain the spread of African swine fever and allows three-year prison sentences for anyone convicted of interrupting organized hunts.

Critics of the bill signed by President Andrzej Duda on Tuesday say the law gives special rights to hunters while restricting the activities of animal rights activists, mushroom pickers and nature walkers.

The prison terms and other criminal penalties apply to people who disrupt both organized sport hunting involving wild animals that are legal to kill and large-scale hunting of wild boar recommended by Poland’s Agriculture Ministry to curb an outbreak of swine fever.

The law provides for up to one year in prison and fines for anyone who disturbs a sport hunt, and up to three years in prison for disturbing a special sanitation hunt.

Animal rights activists have spoken out against the mass killing of wild boar.

Dozens of wild boar in eastern and western Poland have died from swine fever since December, according to the Agriculture Ministry.