Obama, speaking to military families invited to the White House for Independence Day festivities, praised Iraq's independence and thanked troops for their service. Because of the courage, capability and commitment of soldiers who have served in Iraq, the country is now "taking control of its own destiny," he said.
"Iraq's future now rests in the hands of its own people. As extraordinary an accomplishment as that is, we know that this transition won't be without problems," Obama said. "We know there will be difficult days ahead. And that's why we will remain a strong partner to the Iraqi people on behalf of their security and prosperity."
Combat troops this week withdrew from Iraqi cities as part of a security pact that calls for a full withdrawal by the end of 2011. But concerns are growing that a lack of political progress is fueling violence in Iraq.
A roadside bomb exploded Saturday in a town south of Baghdad, killing one civilian and wounding five others, police said.
Violence remains at low levels in Iraq compared with previous years, but a series of bombings that killed scores of people raised concerns about the run-up to the parliamentary elections. At least 447 Iraqi civilians were killed in June, double the toll from the previous month, according to an Associated Press tally.
Obama told service members they were "the latest, strongest link in that unbroken chain that stretches back to the Continental Army." Speaking to those who have served in Iraq and Afghanistan, Obama said the U.S. military has taken on terror and extremism that threaten the world's stability.
The White House invited hundreds of military families to attend the Fourth of July gathering on the White House South Lawn. The celebration included volleyball and face-painting and refreshments such as hot dogs, hamburgers, potato salad, corn on the cob, ice cream and lemonade.
Obama daughters Sasha and Malia joined their parents as the president addressed the military families. Malia Obama turned 11 Saturday.
"I should say that there's also one girl in particular who's just thrilled that all of you are here — and that is Malia Obama, because this happens to be her birthday, as well," Obama said, drawing applause. "When she was younger, I used to say that all these fireworks were for her. I'm not sure she still buys that."