Was it justified to check Ahmed Mohamed's clock for a bomb?

In the photo: The clock built by Mohamed. In September 2015, Ahmed Mohamed, a Muslim Sudanese-American high school freshman, was detained by police at school in Irving, Texas, under suspicion of possessing a hoax bomb. He had brought a home project, where he had reassembled a commercial digital clock inside a locking pencil box, to school to show to his teachers. His English teacher, believing the clock resembled a bomb, and because Mohamed refused to explain the situation, confiscated the project and reported him to the school principal's office. The police were called and Mohamed was questioned for one hour and a half. He was taken into custody, handcuffed, transported to a juvenile detention facility, fingerprinted, and his photograph was taken. He was then released to his parents. The case was not pursued further by juvenile justice authorities but he was suspended from school for three days.

News of the incident went viral on Twitter, and sparked debates on racial profiling and Islamophobia alongside other related topics, as well as raising a number of conspiracy theories and hoax allegations. Politicians, technology company executives, and media personalities remarked on the incident. More: en.wikipedia.org.