U.S. rock bands Pearl Jam and Boston have canceled shows in North Carolina over a new state law they call discriminatory against transgender people, the groups said on Monday.

The cancellations make the bands the latest entertainment acts to take a stance against the measure, known as House Bill 2.

"The HB2 law that was recently passed is a despicable piece of legislation that encourages discrimination against an entire group of American citizens," Pearl Jam, a pioneering grunge rock group, said in a handwritten statement posted on its Facebook page.

RELATED: Cirque du Soleil cancels North Carolina shows over transgender law

Pearl Jam had a Wednesday concert scheduled in Raleigh. Boston, which had its greatest success in the 1970s and 1980s, had been set for three shows next month in the state.

North Carolina last month became the first state to require transgender people to use restrooms and locker rooms in schools and other public facilities that correspond with their birth gender instead of the gender with which they identify.

Former Beatles drummer Ringo Starr, rocker Bruce Springsteen and performance group Cirque du Soleil have canceled North Carolina shows to protest the law. More than 160 business executives have signed a Human Rights Campaign letter pushing for it to be repealed.