U.S. District Judge Sam Lindsay dismissed the lawsuit Ahmed “Clock Boy” Mohamed brought against the Irving Independent School District Wednesday, after he was wrongfully arrested for bringing a device to school that resembled a bomb.

The device at issue was a homemade clock, not a bomb. As Mohamed is a Muslim and the son of Sudanese immigrants, the incident was widely attributed to ethnic and religious stereotyping, prompting the lawsuit.

Mohamed’s father, Mohamed Elhassan Mohamed, filed the complaint on his son’s behalf in Aug. 2016. The suit alleged that the school district discriminated against Ahmed on the basis of race and religion, in keeping with a long history of bigotry in the Irving schools. It also claimed his Fourth Amendment rights were infringed when authorities questioned him for over an hour and a half without his parents.

In turn, the city of Irving said administrators acted legitimately to ensure school safety, even if they were mistaken.

“The top priority of the City of Irving is the safety of its residents, and the City will not be deterred from its mission when it comes to protecting the security and well-being of its school children,” their motion to dismiss reads.

Mohamed’s device included batteries, a printed circuit board, wires, a transformer, a timing display panel, and an alarm bell. On the day of the incident, two teachers advised him to keep the mechanism hidden before he was summoned to the school principal. He was arrested but the charges against him were dropped in short order. The school district assessed a three-day suspension against him.

During the ensuing national drama, former President Barack Obama invited Mohamed to the White House by tweet.

Cool clock, Ahmed. Want to bring it to the White House? We should inspire more kids like you to like science. It’s what makes America great. — President Obama (@POTUS44) September 16, 2015

The Mohamed family briefly moved to Qatar before returning to the Dallas area in June 2016.

City officials said they were “extremely pleased by the court’s ruling, which supports the justifiable actions taken by the officers in the matter.”

“We remain committed to ensuring the safety of all Irving residents and schoolchildren,” the statement added.

A separate lawsuit against a cluster of media figures for defemation was also dismissed in Feb. 2017.

READ the order dismissing Clock Boy’s case

Follow Kevin on Twitter

Send tips to kevin@dailycallernewsfoundation.org.

Content created by The Daily Caller News Foundation is available without charge to any eligible news publisher that can provide a large audience. For licensing opportunities of our original content, please contact licensing@dailycallernewsfoundation.org.