A proud mother's photo of her son praying and reciting the Pledge of Allegiance outside of his elementary school has gone viral.

Mom Heather Nelson captured the touching moment recently after dropping her son, Royce, off at his school in Santa Fe, Texas. She later took to Facebook to explain what unfolded once he exited the car.

"I couldn't really tell what he was doing and I was saying, 'Royce...go...go' as kids walked around him," she wrote of her son. "Well, he didn't budge and I thought, 'What is this child doing?'"

That's when police officer Cibby Moore, who was standing nearby and observing, approached Nelson and told her that the boy was reciting the Pledge of Allegiance and praying before entering the building.

As it turns out, the pledge had reportedly come on the loudspeaker as Royce was approaching the school. Instead of continuing into the building, the kindergartener stopped dead in his tracks to observe the pledge and to pray.

And, according to his mother, "Since they do not have prayer in schools he says a little prayer silently and that's exactly what he was doing."

Royce later told KRIV-TV what he was praying: "Thank you, God. Thank you for giving me a wonderful day."

Moore also spoke out to media after the photo of Royce went viral, saying that she was happy to see the boy acknowledge that the recitation of the pledge was a moment worthy of stopping to observe.

"He just ignored all the other kids around him and kept doing it," she said. "It was awesome."

Nelson said that, once she realized exactly what was going on, her son's actions made her immensely proud, calling the photo she snapped — one that shows her little boy standing with his head bowed — "beautiful."

"I was so proud that he stopped when the Pledge of Allegiance came and stood his ground and did not move as the other kids were going in and then took time out and prayed and did not even care or think twice about it," she wrote.

She also expressed gratitude to Moore for allowing her son the chance to pause and pray, considering that the officer's job is to shuffle kids into the building.

"I'm glad she saw what he was doing and she let him do his thing," Nelson said.

Email: bhallowell@deseretnews.com Twitter: billyhallowell Facebook: facebook.com/billyhallowell