Students and staff got "quite the shock" late in the school day Monday when Selena Gomez made a stop at her former Mansfield middle school, according to district officials.

"Hello students of Danny Jones Middle School," the singer and actress said in an announcement on the Danny Jones Middle School's P.A. system. "This is Selena Gomez talking to you." 

Born in Grand Prairie 27 years ago, Gomez made the surprise visit about 20 miles south to her former middle school in Mansfield. According to an MISD post, she was in town filming a documentary about her childhood when she decided to "pop into the school."

“This trip, I wanted to take my best friend Courtney and also some of my people from my label just to show them where I grew up and how proud I am of where I’m from,” she said. “Some of my teachers I got to see again, and they were part of my life for so long.”

Stephani Gray, the head coach for the girls Lake Ridge High School basketball team, was one of Gomez's seventh-grade teachers who got a surprise visit.

"She was very kind," Gray said of Gomez during her time at the Mansfield middle school. "She had a really kind, soft spirit."

But Gray said she may have underestimated Gomez a little when the young student approached her to say she was withdrawing from the school to move to Florida to star in a "little Disney film."

“And I said, ‘Oh, OK,' because sometimes middle school kids kind of exaggerate," she said. 

Gray said it wasn't long after that she saw Gomez's name pop up during the credits of a Disney film.

Before Gomez left the Danny Jones Monday, she passed on some advice for the middle schoolers.

“What I would tell them is that it’s really hard, but it’s worth it," she said. "I wasn’t a straight-A student by all means, but I think it’s really important, and I think it’s also important to be kind to someone. Just encourage them in their school work and know that anything is possible for them.”

More on WFAA:

RELATED: FEMA officials, contractor accused of hurricane relief fraud, bribery

RELATED: Texas inmate set to be executed Tuesday for killing North Texas woman in 2010

RELATED: Cowboys settle cheerleader pay dispute, entire squad gets pay boost

RELATED: Man forced Guatemalan teen into restaurant work to pay for border crossing