"Michelle and I are honored and proud to have you here on the Fourth," said Obama, addressing the audience from a balcony overlooking the White House's South Lawn, which had been transformed into a sea of red, white and blue for the event.
"It is, after all, your service -- the service of generations of Soldiers, sailors, airmen, Marines and Coast Guardsmen -- that makes our annual celebration of this day possible," he said.
The commander in chief called today's men and women in uniform the "latest, strongest link" in a chain that can be traced to the Continental Army.
"You're the heirs of that legacy of proud men and women who strained to hold together a young union; who rolled back the creeping tide of tyranny; who stood post through a long twilight struggle; who have taken on the terror and extremism that threatens the world's stability," he said.
The nation's defenders are making headway in that battle, Obama said, noting recent events in Iraq.
"... Because of your brave efforts, American troops this week transferred control of all Iraqi cities and towns in Iraq's government to Iraqi security forces," he said. "Because of what you did -- because of the courage and capability and commitment of every single American who has served in Iraq -- a sovereign and united Iraq is taking control of its own destiny.
Iraq's future rests in the hands of the Iraqis now, the president said. "As extraordinary an accomplishment as that is, we know that this transition won't be without problems," he acknowledged. "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."
Obama was joined at the podium by 22 servicemembers, handpicked by each military branch for their heroism and sacrifice. Among them were Army Reserve Sgt. Gregory Ruske and Army Reserve Spc. David Hutchinson, both Silver Star medal recipients singled out for extraordinary heroism in Afghanistan last year.
"... We're humbled to be joined up here by heroes -- men and women who went beyond the call of duty in battle, some selflessly risking their lives again and again so that others might live," the president said.
"True to form, they -- like all of you -- say they were just doing their job," he continued. "That's what makes you the best of us, and that's why we simply want to say thank you to each and every one of you for your extraordinary service to our country."
After his remarks, the president and first lady walked onto the lawn to personally greet - and thank -- their military guests.
Air Force Capt. Ed Yonce, assigned to Dover Air Force Base, Del., and his wife Wendy were among the lucky few who scored a handshake with the president and first lady.
"It's an honor to serve our country and an honor to be here," Yonce said.
"This has been so exciting," said Wendy, who made sure her four children had an unobstructed view of the famous couple.
Marine Corps Cpl. Jonathon Fortune attended the festivities with his wife Kyrie and 11-month-old son Carson. Fortune is a wounded warrior from Bethesda, Md.
"It's been great to meet new people and, of course, be at the White House," Fortune said. "I was pretty excited to be invited here."
The event included a barbecue, with food supplied by the USO, and entertainment by the U.S. Marine Corps Band, Foo Fighters, Michelle Branch and Jimmy Fallon. The Independence Day bash culminated with a prime view of the fireworks set off over the Washington Monument.