Hillary Clinton surprised an 8-year-old girl with a letter earlier this month after the elementary school student lost an election for class president to a boy by a single vote.

Martha Kennedy Morales, a third-grader at a private Quaker school in College Park, Md., decided to run for the top office as part of a lesson on government in which elections for class president and Congress were held, the Washington Post reported. Morales told the paper she lost to a “popular” fourth-grade boy and was affirmed as vice president.

“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,” Clinton wrote in a consoling letter obtained by the Post.

“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.”

— Hillary Clinton

Clinton went on to praise the student by relating her own experience losing to now-President Donald Trump in the 2016 presidential election. The Democratic nominee won the popular vote by a few million but lost in the Electoral College.

TOP HILLARY CLINTON SUPPORTERS IN NH DON'T BUY THE IDEA OF ANOTHER WHITE HOUSE RUN

“The most important thing is that you fought for what you believed in, and that is always worth it,” Clinton wrote.

Morales is now working on writing the former secretary of state a thank-you note, according to the Post.