The San Francisco Symphony announced on Monday that it had canceled a pair of April concerts in North Carolina to protest the new state law curbing anti-discrimination protections for lesbian, gay, bisexual and transgender people.

The orchestra joins a growing list of luminaries who have shunned the state: rockers such as Bruce Springsteen and Ringo Starr; athletes, including the N.B.A., which moved its All-Star Game to New Orleans; and other classical musicians, like the violinist Itzhak Perlman. The symphony’s move shows that the fallout over the law, commonly known as House Bill 2, is continuing to resonate after Gov. Pat McCrory, the Republican who signed it into law, lost his bid for re-election.

The action affects concerts on April 5 and 6 in Chapel Hill, where the symphony had planned to play music by John Cage, Bartok and Mahler before traveling to Carnegie Hall in New York. The orchestra said that it was inspired in part by the mayor of San Francisco, Edwin M. Lee, who decided to bar city employees in publicly funded positions from traveling to North Carolina on business. While the orchestra is not a public entity, officials said that they wanted to honor their role as cultural ambassadors who uphold the values of their city.

Michael Tilson Thomas, the music director of the San Francisco Symphony, was part of a new generation of classical musicians who spoke openly about being gay. He was traveling on Monday and unavailable for comment, but in an interview with The New York Times in front of a live audience earlier this year he spoke of San Francisco as a place that “has allowed me to be, in the fullest sense, an American, a Jew, and, as of two years ago, a gay married man.”