A federal judge has dismissed a lawsuit filed against the Irving school district and the city of Irving by the father of Ahmed Mohamed, the teen whose homemade clock was mistaken for a bomb.

The federal complaint alleged that Ahmed's civil rights were violated in September 2015 when police took him into custody at MacArthur High School and charged him with making a "hoax bomb."

The charge was later dropped.

Ahmed and his father have until June 1 to amend parts of their lawsuit. So, it's likely their legal claims haven't ended entirely.

A family attorney said a new lawsuit would be filed, The Associated Press reported.

"They knew it wasn't a bomb, that he never threatened anyone, that he never said it was a bomb, that he never alarmed anyone," Susan Hutchison, the co-plaintiff attorney, said after the suit was filed. "Despite all of those things, they yanked him out of his chair, put him in handcuffs and arrested him. There was no cause for arrest."

As the court explained, "Principals are responsible for the safety of students and others on campus and, as part of that responsibility, often have to make decisions quickly and with little information. ... A principal's fate is not so hapless that, on the one hand, by not taking action he is faced with the gruesome prospect of death or serious injury of persons had the device actually been a bomb and exploded; and, on the other hand, he is faced with a federal lawsuit for denial of a student's constitutional rights because the device turned out not to be a bomb."

{"type":"video","title":"Dallas News Video","author_name":"Dallas News","_id":"E1YjRnNDE6nYj3H-Zxn_DgD_vxEubPlZ","provider_name":"Ooyala","html":"

","raw":"{\"type\":\"video\",\"title\":\"Dallas News Video\",\"author_name\":\"Dallas News\",\"_id\":\"E1YjRnNDE6nYj3H-Zxn_DgD_vxEubPlZ\",\"provider_name\":\"Ooyala\",\"html\":\"\\u003Cdiv class=\\\"oo-vid-container\\\" data-oo-content-id=\\\"E1YjRnNDE6nYj3H-Zxn_DgD_vxEubPlZ\\\"\\u003E\\u003C\\/div\\u003E\\u003Cscript defer src=\\\"https:\\/\\/www.dallasnews.com\\/resources\\/motif\\/dist\\/js\\/ooyala.js\\\"\\u003E\\u003C\\/script\\u003E\"}","providerType":"ooyala","providerLink":"https://www.dallasnews.com/oembed","embedType":"video"}

Hutchison said the lawsuit was based on the Equal Protection Clause of the U.S. Constitution and Title VI of the Civil Rights Act of 1964.

But U.S. District Judge Sam A. Lindsay on Thursday granted the city and school district's motions to dismiss the Mohamed family's lawsuit, saying there was no evidence Ahmed faced religious or racial discrimination.

"Plaintiff does not allege any facts from which this court can reasonably infer that any IISD employee intentionally discriminated against A.M. based on his race or religion," the judge wrote in his ruling.

Attorneys for the school district — Kathryn Long, Carlos Lopez and Melisa Meyler — said Friday in a written statement that the ruling confirms the school was right to put student safety first.

"The court recognized the challenging situations faced by the individuals who serve our communities in public schools," the statement said. "Schools and principals must make decisions every day regarding student safety. The opinion confirms that there was no suggestion of discriminatory intent by any school district employee."

The city of Irving said in a statement that it "anticipates this case is not over yet" because the lawsuit can be amended.

"The City of Irving will vigorously continue to defend itself, its officers and the justifiable actions taken in this matter in ensuring the safety of schoolchildren and the public," the city said in a statement.

The judge also wrote in his ruling that the family's suit failed to prove that Ahmed's arrest violated his Fourth Amendment rights against unreasonable search and seizure.

"Plaintiff fails to allege a policy, custom, or practice of the City that was the moving force of an alleged constitutional violation," Lindsay wrote.

The suit also questioned the motivations of MacArthur High Principal Daniel Cummings, but the judge said Cummings was merely looking after the safety of the student body when he and an Irving police officer removed Ahmed from his classroom.

"This is not a situation in which a person standing in Principal Cummings's shoes can take unnecessary risks," Lindsay wrote. "On the one hand, by not taking action he is faced with the gruesome prospect of death or serious injury of persons had the device actually been a bomb and exploded; and, on the other hand, he is faced with a federal lawsuit for denial of a student's constitutional rights because the device turned out not to be a bomb.

"Woe unto the principal who fails to act on a potential threat that later becomes a reality!"

In January, conservative commentator Glenn Beck and former Irving Mayor Beth Van Duyne previously were dismissed from a separate defamation suit filed on behalf of Ahmed.