(Reuters) - A Republican candidate running to become North Carolina’s attorney general faced criticism on Tuesday after saying “we must fight to keep our state straight” while discussing a law that restricts transgender bathroom access and gay rights.

The first gender-neutral restroom in the Los Angeles school district is seen at Santee Education Complex high school in Los Angeles, California, April 18, 2016. REUTERS/Lucy Nicholson/Files

The measure has positioned the state at the center of a debate over equality, privacy and religious freedom as states propose legislation seen as discriminatory against gay and transgender people in the wake of a U.S. Supreme Court ruling last year that legalized same-sex marriage.

State Senator Buck Newton made the comment while concluding a speech at a rally on Monday and welcomed the idea of being considered a poster child for the law, dubbed HB 2.

The law made North Carolina the first state in the country to require transgender people to use restrooms in public buildings and schools that match the sex on their birth certificate rather than their gender identity.

“Go home, tell your friends and family who had to work today what this is all about and how hard we must fight to keep our state straight,” he said to applause.

The North Carolina Democratic Party on Tuesday called the comments hateful and discriminatory, demanded Newton apologize, and called on Republican Governor Pat McCrory to denounce the statement.

“One of the Republican sponsors of HB 2 just admitted the real purpose of the law: to make North Carolina unwelcoming to (lesbian, gay, bisexual and transgender) people,” party spokesman Dave Miranda said in a statement.

In a statement on his Facebook page on Tuesday, Newton said “liberals” were “twisting my words.”

Lawmakers on Monday returned to the state’s capital to begin a short session designed to address the state budget, though controversy over the law has drawn much attention.

A group of Democratic representatives on Monday filed a bill seeking a repeal the law, while Republican lawmakers have shown little willingness to back down. Thousands also flocked to Raleigh to show support or disdain for the law.

Business leaders, entertainers and even Republican presidential front-runner Donald Trump have come out against the law. Opponents contend it demonizes transgender people and limits government protections against discrimination for gays and lesbians.