Some teachers said Missouri's original law also could have had other unintended consequences.

Missouri Gov. Jay Nixon signed legislation Friday repealing a contentious law that had limited online chats between teachers and students and caused a judge to warn that it infringed on free-speech rights.

Nixon’s action eliminates a law enacted earlier this year that barred teachers from using websites that allow “exclusive access” with students or former pupils age 18 or younger. The law generated an unexpected backlash, with teachers raising concerns they would be barred from using popular social media sites such as Facebook and Twitter that allow private messages.

A judge temporarily blocked the law shortly before it was to take effect in August, declaring that it “would have a chilling effect” on free-speech rights guaranteed under the U.S. Constitution. Nixon then added the law’s repeal to the agenda for the special session that began in September.

Legislators, who had voted overwhelmingly for the law this spring as part of a broader crackdown on teacher abuse of students, voted overwhelmingly this fall to repeal the restrictions. But the most recent bill they sent to the governor also requires school districts to develop their own policies by March 1 on the use of electronic media between employees and students in order to prevent improper communications.

Nixon said he signed the legislation with some hesitancy. The governor said school districts may find it challenging to develop policies that prevent improper communications without also preventing appropriation online conversations.

“This bill is not as good as it should be, but to veto it would return us to a bill that would be far worse,” Nixon said in a written statement announcing his decision.