RALEIGH, N.C. — The president of North Carolina’s NAACP will remain barred from the state Legislative Building until a case involving his arrest during a May sit-in is resolved.

The Rev. William Barber was among more than 30 protesters charged with second-degree trespassing. A magistrate set the prohibition, but an NAACP attorney told a Wake County judge the blanket ban was unconstitutional by preventing citizens from petitioning lawmakers. A prosecutor disagreed.

District Court Judge Michael Denning modified the orders for Barber and eight others considered Wednesday.

Denning told attorneys by email late Wednesday that Barber and four others still won’t be allowed to return to the building until their cases are over. Another four can visit unless a legislator invites them for a certain time and stays with them.