Ahmed Mohamed, 14, was arrested after bringing a homemade clock to his Texas high school to show his teachers and was later accused of having a “hoax bomb.” (Jim Watson/AFP/Getty Images)

The Muslim boy who found himself in the national spotlight after he was wrongfully arrested for bringing a homemade alarm clock to school has lost in a defamation lawsuit against conservative media companies and personalities.

The lawsuit accused Fox Television Stations and TheBlaze, as well as television and radio personalities such as Glenn Beck, Ben Ferguson and Ben Shapiro, of airing and making false statements accusing Ahmed Mohamed and his family of being terrorists. The 21-page complaint alleged that the defendants misled the public and, in doing so, fanned “the flames of fear and anger toward Muslims and immigrants.”

Fox; TheBlaze and its founder, Beck; the Center for Security Policy, a D.C.-based think tank, and its executive vice president, Jim Hanson; television and radio personalities Ferguson and Shapiro; and Beth Van Duyne, mayor of the Texas city where the Mohameds lived, were all sued by the boy’s father, Mohamed Mohamed, in Dallas County in September.

Over the last two months, a judge has tossed out the cases against all but two of the defendants, with the last round of dismissals happening on Monday.

A hearing on Shapiro’s motion to dismiss is scheduled for Jan. 30. Van Duyne reached an agreement with the plaintiffs to dismiss the case against her, Susan Hutchison, the Mohamed family’s attorney, said.

The judge found that the defendants are protected under the Texas Citizens Participation Act, a state law designed to fight Strategic Lawsuits Against Public Participation, also known as SLAPP. The statute, enacted in 2011, protects citizens from defamation lawsuits on the basis of rights to free speech.

Radio host Glenn Beck speaks during a rally in Washington. (Jacquelyn Martin/AP)

Hutchison said the Mohameds plan to appeal the ruling.

“Certainly, we think it’s not correct. People, particularly the media, should not have a free pass to misrepresent things and lie about people and damage their reputations and standing in the community,” Hutchison told The Washington Post.

Mike Grygiel, who represents Beck and TheBlaze, said in a statement that his clients are pleased that the court applied the law “to protect free speech through the summary dismissal of unmeritorious defamation claims.”

Hanson, of the Center for Security Policy, said in a statement that the ruling “reaffirms our most fundamental liberty — the right to free expression — and punishes Mr. Mohamed and his allies for attempting to suppress ideas they oppose.”

The defamation lawsuit was filed about a year after Ahmed was arrested and interrogated by Irving police in September 2015, when he brought an alarm clock that a teacher thought to be a bomb. Libelous statements about the then-13-year-old were made in the media shortly after, according to the complaint.

“The broadcasts aired by Fox and the Blaze are the very definition of ‘yellow journalism,'” the complaint said. “To broadcast inaccurate, biases and sensationalized falsehoods in the guise of ‘news’ is an offense, not just to the victims of the defamatory statements, but to the public.”

Ahmed had developed a love for robotics and was known for creating elaborate contraptions and bringing them to school to please his teachers, the complaint said. One day, he brought an alarm clock he created out of old batteries, a pencil box he had when he was in middle school and other gadgets he found in his family’s garage, and showed it to his geometry teacher at MacArthur High School.

The teacher thought the device was a bomb, and took the alarm clock from Ahmed, telling him she would hold it for him for the rest of the day, according to the complaint.

Several hours later, police officers showed up at the school.

Texas ninth grader Ahmed Mohamed was arrested after his homemade clock was mistaken for a bomb. Here's what you need to know. (The Washington Post)

Ahmed was pulled out of his chair during class, handcuffed and escorted out of the school, according to the complaint. He was brought to the police station, where his mug shots and fingerprints were taken.

During a 1½-hour-long interrogation, Ahmed repeatedly told officers that he brought an alarm clock to school, not a bomb, the complaint says. Despite repeated pleas to talk to his parents, he was told he couldn’t.

The Irving police chief later admitted that the arrest was a mistake. The charge — possession of a hoax bomb — was dropped.

According to an internal police department email obtained through a public records request, one of the officers said “that thing doesn’t even look like a bomb,” the complaint says.

Still, Ahmed was disciplined and suspended for three days for code of conduct violation and possession of prohibited items. The incident has since prompted the U.S. Department of Justice’s civil rights division to investigate the Irving Independent School District. That investigation remains pending.

The incident turned the teenager into a viral sensation and earned him the nickname “Clock Boy” or “Clock Kid.”

That same month, TheBlaze aired a show hosted by Beck in which he and guests Hanson, of the Center for Security Policy, and Van Duyne, the Texas mayor, discussed Ahmed’s arrest.

“My theory is that for some reason Irving is important to the Islamists, not the Muslims, but the Islamists. It could be as simple as the progressives trying to turn Texas blue, and this is just the place where they’re just going to start planting the seeds and taking a stand,” Beck said on the show.

Van Duyne said on the show that Ahmed was not forthcoming to police and school officials about what he’d brought to school, and that his family didn’t respond to requests for records from the city. The lawsuit claims that wasn’t true.

In response to Beck, Hanson said that Ahmed’s arrest was a publicity stunt by terrorists, and that someone persuaded the boy to bring the device to school.

“They wanted people to react, and they wanted to portray this kid as an innocent victim,” Hanson said. “I think he was a pawn potentially by his father.”

Over the next two months, Shapiro and Ferguson made similar statements on Fox News and Fox 4 News, respectively.

“I think he used his son. He is one of those, you know, ‘I’m gonna point out anyone that’s against Islam type of guy. I’m going to cause problems.’ They preplanned this. It looked like a bomb. He also didn’t create a clock. He took a clock apart and he put it in a mini-briefcase to make it look like a bomb,” said Ferguson, who also said that Ahmed loved his newfound fame and compared him to the Kardashians.

In an earlier email response to The Washington Post, Hanson repeated statements he’d made about Ahmed’s father, saying he’s using his son “as a pawn in a political game.”

“This lawsuit is just another example of that and worse an attempt to silence the truth tellers who expose the Islamist agenda,” Hanson said. “They will not silence us and we hope that others who may fear to speak up will be heartened when he prevail, and we will.”

The center’s general counsel, David Yerushalmi, called the lawsuit “frivolous,” an example of “malicious prosecution” and “Islamist lawfare.”

The lawsuit demanded that the defendants publicly retract statements they’d made about Ahmed’s arrest.

Ahmed’s family also recently filed a civil rights lawsuit against his former Texas school district, the principal of the high school and the city of Irving.

The boy and his family left Irving and moved to Qatar in October 2015.

This story, originally published on Sept. 28, 2016, has been updated.

Read more:

Playboy’s interview with a Muslim woman mocks modesty and offends women

As the nation debates the place of Islam, the CIA’s Muslim officers fight terrorism

Donald Trump is bringing anti-Muslim prejudice into the mainstream