Washington recognised the African nation's government for the first time since 1991.
Obama dropped by a meeting between Mohamud and US Deputy National Security Adviser Denis McDonough at the White House, before the Somali leader headed across town to see Secretary of State Hillary Clinton, a White House statement said.
"The president congratulated [Mohamud] on his election last September and the establishment of the first permanent, representative government in Somalia in two decades," the statement said.
"The president noted the impressive security and political gains over the past year in Somalia. He acknowledged the many challenges facing Somalia but expressed optimism about Somalia's future," said the statement, accompanied by a photograph of the leaders meeting in the Roosevelt Room of the White House.
Somalia has not had an effective central government since 1991. But a new administration took office last year, ending eight years of transitional rule by a corruption-riddled government.
The US move turned the page on a dark chapter that in 1993 saw Americans anguished by scenes of US soldiers being dragged through the streets of Mogadishu by a mob after Somali militants shot down two Black Hawk helicopters. Eighteen Americans died and 80 were wounded. – Sapa-AFP