US District Judge William H. Orrick in San Francisco ruled that Twitter cannot be held liable for Islamic State's rhetoric, but gave the plaintiff a chance to refile an amended lawsuit.
Social media companies including Twitter have faced pressure to crack down on online propaganda linked to terrorism.
Tamara Fields, a Florida woman whose husband Lloyd died in an attack on the police training centre in Amman last year, said Twitter knowingly let the militant Islamist group use its network to spread propaganda, raise money and attract recruits.
While Orrick called the deaths "horrific," he agreed with Twitter and said federal law protects the company from liability for the content that third parties publish on its platform.
Attorneys for Fields and a Twitter representative could not immediately be reached for comment.
In her complaint filed earlier this year, Fields said San Francisco-based Twitter had until recently given Islamic State, also known as Isis, an "unfettered" ability to maintain official Twitter accounts.
"Without Twitter, the explosive growth of Isis over the last few years into the most-feared terrorist group in the world would not have been possible," the lawsuit said.
Twitter had previously said the lawsuit was without merit, but that "violent threats and the promotion of terrorism deserve no place on Twitter and, like other social networks, our rules make that clear."
© Thomson Reuters 2016