North Carolina Governor Pat McCrory on Tuesday defended signing a law that targets the LGBT community as he debated Attorney General Roy Cooper, his Democratic rival.

Republican leaders approved House Bill 2 during a one-day special session in March after Charlotte approved a measure that protects the LGBT community from discrimination. The law blocks cities and municipalities from enacting such measures and prohibits transgender people from using the bathroom of their choice in government buildings and schools.

Cooper noted the backlash against the law and promised to repeal it.

“We need a good jobs governor, not an HB2 governor,” Cooper said.

McCrory blamed Cooper and Charlotte Mayor Jennifer Roberts for the controversy.

“Governor, what planet on you on?” Cooper replied. “We've got to stop blaming it on others.”

“The attorney general doesn't deny that he and Jennifer Roberts started this,” McCrory answered, adding that the law was needed to protect people's privacy.

When moderator Chuck Todd of NBC News asked which restroom Caitlyn Jenner, possibly the world's most famous transgender person, should use, McCrory said that in public she should use the men's room.

“If [Jenner] is going to a shower facility at UNC Chapel Hill after running around the track, she's going to use the men's shower,” McCrory said.