He may be the most powerful man in the world but President Barack Obama has reminded the world that he is a father first.

Twitter and Facebook images have captured the US leader setting politics aside to comfort some of the grieving relatives of those killed in the Sandy Hook school massacre in Newtown, Connecticut.

The recently re-elected president spent time with parents and families in the small New England town where lone gunman Adam Lanza killed 20 children and six adults in America's worst-ever school shooting. Obama then went on to speak at an interfaith service.

During his time, he shared an emotional embrace with Robbie Parker, who lost his six-year-old daughter, Emilie, in the massacre.

The father-to father moment appeared to provide a distraught Parker a brief solace and he later posed for a snap with Obama, with his wife and remaining two daughters.

Obama, who has daughters Sasha and Malia, also took the personal approach when he spent time with the baby granddaughter of murdered school principal Dawn Hochsprung.

She was gunned down when she tried to stop Lanza entering the building.

Hocksprung's daughter, Cristina Hassinger, tweeted a picture of him holding the baby and added the caption: "My mom would be so proud to see President Obama holding her granddaughter. But not as proud as I am of her".

In one of the most poignant speeches of his presidency, Obama vowed to protect the children of the United States.

"You are not alone in your grief," he said. "All across this land our world too has been torn apart. All across this land we wept with you and pulled our children tight. Newtown, you are not alone.

"We gather here in memory of 20 beautiful children and six remarkable adults. Whatever measure of comfort we can provide, we will provide it."