A Muslim teenager built a simple clock out of electronic components and took it to show his engineering teacher at school — but he was arrested when another teacher thought it looked like a bomb and alerted administrators.

Police in Irving, Texas, never suspected the device was an explosive device and did not alert the bomb squad, but they still arrested 14-year-old Ahmed Mohamed because he could offer no “broader explanation” for his clock besides describing it as a device that measures time.

ADVERTISEMENT

When another 14-year-old boy built a nuclear reactor at his parents’ home he was invited to meet with officials from the U.S. Department of Homeland Security and the U.S. Department of Energy — who offered their expert assistance, equipment and encouragement to apply for a research grant.

READ MORE: The mayor of Ahmed Mohamed’s town is a well-known conservative folk hero for fighting fake Muslim ‘threats’

Irving police chief admits: Cops knew Ahmed Mohamed didn’t have a bomb when they arrested him

Taylor Wilson, who is white, entered his nuclear fusion reactor five years ago in a series of science fairs that eventually won him a trip to Switzerland, where he toured the Large Hadron Collider — the world’s largest particle accelerator.

Wilson, now 21 years old, later won $50,000 at a science fair for an anti-terrorism device he invented that can detect nuclear materials in cargo containers.

He demonstrated that device to President Barack Obama at another science fair organized at the White House.

ADVERTISEMENT

The president also invited Mohamed to visit him at the White House after the Muslim teen’s story sparked national outrage over an apparent double standard.

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 (@POTUS) September 16, 2015

ADVERTISEMENT

A black Florida teen was arrested and expelled in April 2013 after her science fair experiment, which involved mixing toilet bowl cleaner and aluminum foil in a plastic water bottle, created a chemical reaction that resulted in a firecracker-like “pop” and some smoke.

The reaction caused no injuries or damage, but the principal of Bartown High School feared the device had violated school policies.

ADVERTISEMENT

Police charged Kiera Wilmot, then 16, with possession and discharge of a weapon on school grounds and with discharging a destructive device.

The honors student was eventually cleared of charges and went to the U.S. Space Academy after a NASA veteran heard about her story and paid for scholarships for Wilmot and her twin sister.

Watch Taylor Wilson discuss his nuclear reactor in this TED Talk: