A Texas teenager who was suspended from school for bringing a homemade clock to class received a 21st century invitation from President Obama on Wednesday to visit the White House.

Instead of making a traditional phone call, Obama took to his personal Twitter account to invite Ahmed Mohamed, 14, of Irving, Texas, to show off the device at 1600 Pennsylvania Ave.

ADVERTISEMENT

“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,” the president tweeted.

Obama’s invitation placed him in the middle of a story that captured national attention and sparked a conversation about racial and ethnic profiling.

Mohamed, who is Muslim, was arrested by Irving police on Monday and suspended from MacArthur High School after teachers mistook his clock for a bomb.

No charges were filed against the ninth-grader, who said he built the clock because he is interested in engineering and technology.

The story went viral on social media. By Wednesday afternoon, 730,000 tweets were made using the hashtag #IStandWithAhmed to discuss the story or show support for Mohamed.

Mohamed indicated at a press conference late Wednesday afternoon that he accepted Obama's invitation to come to the White House.

"I felt pretty down that no one would know about this," the smiling teenager said, adding that the outpouring of online support made him "really happy."

Mohamed said that he was still suspended from school until Thursday, and that he was looking at transferring.

The student's father said he believes his son was arrested because he is Muslim and named Mohamed. Mohamed Elhassan Mohamed, a Sudanese immigrant, added that the anniversary of the Sept. 11, 2001, terrorist attacks may have played a role in the incident.

Irving Independent School District spokeswoman Lesley Weaver defended the actions of teachers and administrators at Mohamed’s school.

“We were doing everything with an abundance of caution to protect all of our students in Irving,” she said, according to the Dallas Morning News.

But the White House disagreed. Press secretary Josh Earnest said “it’s clear some of Ahmed’s teachers failed him” and that the best teachers should “nurture the intellectual curiosity of our students.”

Earnest said Mohamed would be invited to attend Astronomy Night at the White House on Oct. 19, where he and other students will meet with astronauts, scientists and engineers.

The incident appeared to resonate with Obama, who has urged students to pursue education in the science, technology, engineering and math (STEM) fields and promoted diversity there.

“Our lead will erode if we don’t make some good choices now,” he said in a February interview with the tech news website Re/code. “We’ve got to have our kids in math and science and it can’t just be a handful of kids, it’s got to be everybody.”

Since his 2008 campaign, Obama has also battled false accusations that he secretly practices Islam. A CNN poll released Sunday showed that three in 10 Americans — and 43 percent of Republicans — believe Obama is a Muslim.

Earnest encouraged the public to use Mohamed’s story as a “teachable moment.”

“This episode is a good illustration of how pernicious stereotypes can prevent even good hearted people who dedicate their lives to educating young people from doing the good work they set out to do,” he said.

A number of other politicians and officials joined in the wave of sympathy for Mohamed, including Education Secretary Arne Duncan Arne Starkey DuncanThe Hill's 12:30 Report: White House, Dems debate coronavirus relief package For the sake of equity, reopen schools — digitally, with exceptions It's up to local leaders: An Iowa perspective on reopening schools MORE, who tweeted “we need to be encouraging young engineers, not putting them in handcuffs. #IStandWithAhmed”

“Assumptions and fear don't keep us safe—they hold us back. Ahmed, stay curious and keep building,” tweeted Democratic presidential candidate Hillary Clinton Hillary Diane Rodham ClintonJoe Biden looks to expand election battleground into Trump country Biden leads Trump by 12 points among Catholic voters: poll The Hill's Campaign Report: Biden goes on offense MORE.

Ahmed brought the clock to school on Monday to impress his engineering teacher, according to the Morning News. But after its alarm went off in the middle of English class, another teacher inspected the device and reported him to a school administrator.

Mohamed, clad in a NASA T-shirt, was suspended for three days and led out of school by police in handcuffs. He has vowed never to take an invention to school again, the Morning News reported.

—This story was last updated at 5:46 p.m.