An 8-year-old Maryland girl who ran for class president this year got some surprising words of encouragement after losing the close race. Third-grader Martha Kennedy Morales lost her bid for president by just one vote, but the pain of losing was soothed by a special letter from a new mentor: Hillary Clinton.

When Morales lost the presidency to a boy at her school, her dad posted about it on Facebook, CBS affiliate WUSA reports. Albert Morales wrote that although is daughter did not win, she came in second place and is now Friends Community School's vice president.

Soon, the father's message spread, and a "mystery person" passed the message along to Clinton. The family was shocked when the former presidential candidate sent a letter of support to the 8-year-old.

Get Breaking News Delivered to Your Inbox

"The most important thing is that you fought for what you believed in," Clinton wrote. "And it is always worth it."

Clinton alluded to her own experience running for president, writing, "As I know too well, it's not easy when you stand up and put yourself in contention for a role that's only been sought by boys."

Maryland third-grader Martha Kennedy Morales received a letter full of encouragement from Hillary Clinton after losing her race for school president. WUSA

Morales was in disbelief that her idol sent her a letter. "There it was," he said. "This folded piece of paper... I was like 'what in the world.'"

"I remember the pink shirt that she was wearing on the night of the election," Morales said. "I've had dreams about wearing that pink shirt."

The 8-year-old has written a reply to the former first lady and secretary of state, and plans to send it to her soon. She also invited Clinton to visit her. She lives in an area familiar to the Clintons: just outside of Washington, D.C.

"To know that Hilary Clinton is cheering me on for future success, I mean, this is really special," Morales said.

While Morales won't be eligible to run for president of the United States until 2045, hopefully her fighting spirit will stay with her as she grows up.