A 10-year-old Californian has found a pen pal in President Barack Obama.

Sophia Bailey-Klugh has been sending letters to the president routinely. Her first such letter invited Obama to dinner, but she received no reply.

But when the young San Diegan sent him a letter thanking him for his stance on gay marriage, she received a speedy reply from Obama himself, CNN reported.

A daughter of two gay fathers, Sophia’s story first became news when one of her dads, Jonathan Bailey, posted her letter on Facebook on Oct. 28, with the note that her letter was “unprompted” and made her father and his partner "so unbelievably proud."

"Dear Barack Obama," she wrote. "It's Sophia Bailey Klugh, your friend who invited you to dinner. If you don't remember, okay, that's fine. But I just wanted to tell you that I am so glad you agree that two men can love each other because I have two dads and they love each other."

Sophia then talked about how students at her school call her fathers’ relationship "gross and weird," and she asked the president for his advice.

"It really hurts my heart and feelings, so I come to you because you are my hero," she wrote.

She concluded by wishing him luck on the election and asking him to say hi to his daughters Sasha and Malia.

The letter also included a hand-drawn picture of Sophia’s two dads kissing, with the caption “love.”

Sophia soon received a letter on official presidential letterhead, postmarked Nov. 1.

"Thank you for writing me such a thoughtful letter about your family. Reading it made me proud to be your president and even more hopeful about the future of our nation," Obama wrote in his reply.

"In America, no two families look the same," he continued. "We celebrate this diversity. And we recognize that whether you have two dads or one mom what matters above all is the love we show one another. You are very fortunate to have two parents who care deeply for you. They are lucky to have such an exceptional daughter in you."

In response to her request for advice, Obama wrote, "A good rule is to treat others the way you hope they will treat you."

"Thanks again for taking the time to write me," he continued. "I'm sorry I couldn't make it to dinner, but I'll be sure to tell Sasha and Malia you say hello," he concluded.

Following a vote in North Carolina that approved a constitutional amendment banning same-sex marriage in May, the president publicly stated in a televised interview that he had "evolved" in his position on the issue and felt that same sex couples should be able to marry legally, according to CNN.

Jonathan Bailey also posted the president's response on Facebook.

"Thank you Barack Obama -- you have made one 10-year-old feel mighty special (and her two dads, too)," he wrote in the caption for the image.