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.

The Missouri State Teachers Association, which filed suit against the original law, said Friday that it would decide within the coming weeks whether to drop the case. The judge's preliminary injunction against the original law was to remain in effect until Feb. 20 so that a hearing could be held on a permanent injunction.

Missouri's main teacher and administrator groups supported the repeal. But the American Civil Liberties Union had encouraged Nixon to veto the new bill, because of its directive for local schools to develop their own policies.

"We think the current legislation just passes the buck to the various school boards and doesn't really solve the problem," said John Chasnoff, program director for the ACLU of Eastern Missouri

The legislation passed during the special session was necessary to repeal "a law that was overreaching," said Todd Fuller, a spokesman for the Missouri State Teachers Association. But the group now plans to monitor the policies enacted by Missouri's 523 public school districts.

The concern is "there will still be districts out there that say you can't use Facebook no matter what, or you can't use this type of social media regardless of whether you're using it in the classroom or outside the classroom," Fuller said.

Although the potential effect on Facebook users garnered the headlines, some teachers said Missouri's original law also could have had other unintended consequences. For example, one teacher feared the law could have prevented her class from communicating with students in Australia through a closed website. Others raised concerns about the law's effect on editing software for school yearbooks or on virtual classrooms, in which students communicate with direct messages

The original limits on Internet communications spurred virtually no discussion at the Capitol when they were included in a broader education bill passed earlier this year. One of main provisions of that bill requires schools to share information with other districts about teachers who have sexually abused students and allows lawsuits in cases where districts fail to disclose such information and teachers later abuse someone else. That portion of the law was not challenged in court and was not repealed.