After suffering weeks of empty legal threats over its online prostitution ads, Craigslist went on the offensive Wednesday with a federal lawsuit against South Carolina's attorney general, seeking a restraining order that would block any further threats and prevent any criminal prosecution by the state.

Henry McMaster, the state attorney general, called the lawsuit against him "good news," because it shows Craiglist its taking the matter seriously. At the same time, McMaster backpedaled away from his earlier threats. "This office and the law enforcement agencies of South Carolina will continue to monitor the site to make certain that our laws are respected," he said in a statement.

McMaster has been blustering against Craigslist since May 5, when he vowed to launch a criminal investigation against the site and its management, if Craigslist did not find a way to block all prostitution ads in its South Carolina section and prevent any posts containing pornographic images. The threats came despite reforms Craigslist launched in November last year to try to stem the flow of prostitution ads.

The prosecutor gave Craigslist a May 15 deadline to block the content, and Craigslist responded last week by announcing it was closing its "erotic services" subcategory site-wide, creating a new "adult services" replacement in which every post is prescreened by staffers.

But the action did nothing to stop the threats, according to Craigslist CEO Jim Buckmaster, who announced the lawsuit in a blog post Wednesday. Buckmaster said McMaster threatened prosecution as recently as Sunday.

"We opened an investigation at 5:01 on Friday, as promised," McMaster reportedly said. "We are preparing for a prosecution. We are investigating. We are moving forward.… The No. 1 defendant is Mr. Jim Buckmaster, who is the man in charge of Craigslist.… Craigslist is a big promoter and facilitator of prostitution."

The company responded in court Wednesday. "Despite Craigslist's legal immunity from criminal or civil liability under state law for unlawful third-party content on its website, and despite the numerous good-faith actions that Craigslist has voluntarily taken to deter abuse of its service by third parties … McMaster has persisted in threats to criminally prosecute Craigslist on the basis of third-party content appearing on the Craigslist website," reads the company's application for a temporary restraining order (.pdf).

The lawsuit, filed in U.S. District Court in South Carolina, charges that McMaster's threats violate Craigslist's rights under the Communications Decency Act, a federal law that generally holds an internet forum free of liability for its users' posts. McMaster's statements also harmed the site's free-speech rights under the Constitution, and created an undue burden on interstate commerce, the lawsuit alleges.

Craigslist is seeking a temporary restraining order now, to be followed by a permanent injunction preventing further threats or prosecution. The company is also asking for attorney fees.

There's no doubt that an enormous amount of prostitution, including some child-sex trafficking, has unfolded on Craigslist over the years. But Craigslist says its November reforms — including requiring "erotic services" posters to have a valid credit card — have already made a huge dent in the problem. Because the site is largely an open forum, Craigslist can't provide 100 percent assurance that no illegal activity will be promoted in its ads, Buckmaster wrote Wednesday. Therefore acceding to McMaster's demands would have required that Craigslist pull out of South Carolina completely.

McMaster's threats against Craigslist and its CEO have been toothless from the start, because the site enjoys immunity from state criminal action under the federal Communications Decency Act. Wednesday's lawsuit was most likely intended to put an end to the nuisance of McMaster's tough talk, and to head off a pointless, but potentially costly, criminal case, says Marcia Hoffman, an attorney with the Electronic Frontier Foundation, which is not a party to the lawsuit.

"I think their position is, it's so obvious that they can't be prosecuted, it should just be barred from the outset so they don't have to deal with it," says Hoffman. "Even if the criminal prosecution is baseless, they would still have to spend time and money defending it."

In his statement Wednesday, McMaster belatedly acknowledged Craigslist's shuttering of its erotic services category, "as we asked them to do. And they are now taking responsibility for the content of their future advertisements. If they keep their word, this is a victory for law enforcement and for the people of South Carolina."

"Unfortunately, we had to inform them of possible state criminal violations concerning their past practices to produce a serious response," he continued. "We trust they will now adhere to the higher standards they have promised."