A federal grand jury in Washington, D.C., is investigating a man who allegedly used Twitter to threaten U.S. Rep. and former presidential candidate Michele Bachmann.

In a court opinion made public this week, a U.S. District Court judge ruled against a man's request to deny a grand jury subpoena seeking his identity from Twitter, a popular social networking site. The man's "professed desire to engage in sadomasochistic activities" with Bachmann prompted the investigation.

After learning about a vulgar message that involved Bachmann while she was campaigning in Iowa during a presidential straw poll in August, the grand jury sent the subpoena to Twitter to learn the man's identity. Twitter promptly alerted the man -- who is identified as "Mr. X" in the judge's opinion -- to the subpoena. Mr. X filed a motion in federal court seeking to deny it.

In his opinion, the judge said the poor taste of the messages was almost incomprehensible. But he did argue that the government has a compelling interest in investigating the threats against Bachmann and needed Mr. X's identity to determine the threat's legitimacy.