Hillary Rodham Clinton offered moral support to a distraught gay youth who shared his anxiety about his future in a viral photograph posted on the Humans of New York Facebook page, telling him on Friday that it would be “amazing.”

The boy, who is not named in the photo, is shown frowning and holding his head in his hands while sitting on a stoop.

“I’m homosexual, and I’m afraid about what my future will be and that people won’t like me,” he said, according to the caption.

Two hours after the picture was posted, Mrs. Clinton typed out some words of encouragement and signed her comment “H,” indicating that it was written by her and not by a member of her staff.