Hillary Clinton writes letter of encouragement to 8-year-old girl who lost class presidency to boy The former secretary of state shared her words of wisdom.

Martha Kennedy Morales is only 8 years old, but the College Park, Maryland, elementary school student already knows the disappointment of narrowly losing an election.

Luckily, Morales got just the pick-me-up she needed from someone who's come out the other side of a losing election: Hillary Clinton.

Clinton earned the admiration of a girl who wasn't even born when she first mounted a run for president when she recently wrote a letter to Morales after the girl's loss -- by one vote -- to a boy in a race for class president.

Clinton, who learned of the election from the girl's father's Facebook page, wrote: "While I know you may have been disappointed that you did not win president, I am so proud of you for deciding to run in the first place. As I know too well, it's not easy. Never stop standing up for what is right and seeking opportunities."

Her father Albert Morales doesn't know how news of his daughter's loss ended up in front of the former secretary of state.

"I work in the political space in Washington, D.C.," he told ABC News. "I have friends who worked with her in the past, but whoever did it, did it anonymously."

Martha’s school has learned all about the U.S. government, and the election was a learning experience for the class, a combination of third- and fourth-graders. Students serve on committees as well and the third-grader is on the natural resources committee and interested in saving the environment.

Her platform in the race: getting a class pet, she told Washington ABC affiliate WJLA.

"I was updating Facebook friends and family really, I knew they wanted to know Martha’s progress," said Albert Morales.

It's not all bad news for Martha, who, as second-place finisher, was named vice president.

"As vice president, Martha has the deciding vote, just like in real life," he said.

The letter certainly lifted her spirits, now the little girl is hopeful she can become U.S. president one day.