It's Ms Gillard's first visit to Washington as prime minister. During the 40-minute meeting, the two leaders discussed the mission in Afghanistan, trade issues and developments in the Middle East and North Africa.
Mr Obama said Australia and the United States had many things in common.
"Because of the shared values and because of the deep, long-continuing relationship between our two countries, it's extraordinary to have Julia Gillard here," he said.
"I have to say that, from a distance at least, she is doing an outstanding job."
Mr Obama said both the US and Australia wanted to see swift, firm and comprehensive sanctions against Libya and the regime of Muammar Gaddafi "will be held accountable for whatever violence takes place there".
The leaders later visited a high school in Virginia where they spoke with students about Australia.
Ms Gillard was asked "what is vegemite", and explained what it was.
Mr Obama said: "It's horrible."
He described it as "a quasi-vegetable byproduct spread".
Ms Gillard also told the class about the extent of flooding in Australia in recent months and she revealed she had given the president an Aussie Rules football as a present, which Mr Obama joked they had kicked around in the Oval Office.