WASHINGTON -- President Barack Obama is marking the Fourth of July by thanking service members and their families, who he said "represent what is best in America."

The president, accompanied by first lady Michelle Obama, hosted a barbecue and concert Wednesday for the families on the White House South Lawn.

Obama saluted "this generation of heroes" for their service and sacrifice to defend American freedoms, specifically thanking them for bringing Osama bin Laden to justice and working to get out of Afghanistan.

He said the nation "will always be there for you, just as you've been there for us." He said it was his promise, and America's promise.

Afterward, the Obamas shook hands and posed for pictures with eager visitors. The U.S. Marine Band and country singer Brad Paisley performed.

Related on HuffPost:

Loading Slideshow...
  • The Empire State Building, illuminated with red, white and blue lights, is seen from the Queens borough of New York, backlit by fireworks lighting up the sky over the Hudson River, during the Macy's Fourth of July fireworks show Wednesday, July 4, 2012, in New York. (AP Photo/Frank Franklin II)

  • Fireworks explode over the Philadelphia Museum of Art during an Independence Day celebration, Wednesday, July 4, 2012, in Philadelphia. (AP Photo/Matt Rourke)

  • Fireworks light up the sky over the Philadelphia Museum of Art during an Independence Day celebration, Wednesday, July 4, 2012, in Philadelphia. (AP Photo/Matt Rourke)

  • Fireworks illuminate the night sky over

    Fireworks illuminate the night sky over the Washington Monument and the Capitol Dome (bottom) during Fourth of July celebrations in Washington, DC, on July 4, 2012. Independence Day, commonly known as the Fourth of July, is a federal holiday in US commemorating the adoption of the Declaration of Independence on July 4, 1776, declaring independence from the Kingdom of Great Britain. AFP PHOTO/Jewel Samad (Photo credit should read JEWEL SAMAD/AFP/GettyImages)

  • Fireworks Light Up Skies Over NYC On Fourth Of July

    NEW YORK, NY - JULY 04: Nicola McIntosh holds Jada Weekes as they watch the fireworks display along the Hudson River from Manhattan on July 4, 2012 in New York City. Revelers around the country are celebrating the nation's independence. (Photo by Mario Tama/Getty Images)

  • Bill Sandidge, Nancy Koughan

  • Fireworks illuminate the night sky duri

    Fireworks illuminate the night sky during Fourth of July celebrations in Washington, DC, on July 4, 2012. Independence Day, commonly known as the Fourth of July, is a federal holiday in US commemorating the adoption of the Declaration of Independence on July 4, 1776, declaring independence from the Kingdom of Great Britain. AFP PHOTO/Jewel Samad (Photo credit should read JEWEL SAMAD/AFP/GettyImages)

  • Fireworks illuminate the night sky over

    Fireworks illuminate the night sky over the Washington Monument (bottom) during Fourth of July celebrations in Washington, DC, on July 4, 2012. Independence Day, commonly known as the Fourth of July, is a federal holiday in US commemorating the adoption of the Declaration of Independence on July 4, 1776, declaring independence from the Kingdom of Great Britain. AFP PHOTO/Jewel Samad (Photo credit should read JEWEL SAMAD/AFP/GettyImages)

  • Spectators watch as fireworks light up the sky over the Hudson River during the Macy's Fourth of July fireworks show Wednesday, July 4, 2012, in New York. (AP Photo/John Minchillo)

  • Spectators watch as fireworks light up the sky over the Hudson River during the Macy's Fourth of July fireworks show Wednesday, July 4, 2012, in New York. (AP Photo/John Minchillo)

  • Spectators watch as fireworks light up the sky over the Hudson River during the Macy's Fourth of July fireworks show Wednesday, July 4, 2012, in New York. (AP Photo/John Minchillo)

  • Fireworks light the sky over the U.S. Capitol, left, Washington Monument and Lincoln Memorial in Washington on Wednesday, July 4, 2012, as seen from Arlington, Va. (AP Photo/Alex Brandon)

  • Fireworks light the sky over the U.S. Capitol, left, Washington Monument and Lincoln Memorial in Washington on Wednesday, July 4, 2012, as seen from Arlington, Va. (AP Photo/Alex Brandon)

  • Fireworks light up the sky during the annual Macy's Fourth of July fireworks display over the Hudson River as seen from New York, Wednesday, July 4, 2012. (AP Photo/Jeffrey Furticella)

  • WASHINGTON, DC - JULY 04: Fireworks light up the sky over the Lincoln Memorial, Washington Monument, and the U.S. Capitol on July 4, 2012 in Washington, DC. July 4th is a national holiday with the nation celebrating its 237th birthday. (Photo by Mark Wilson/Getty Images)

  • WASHINGTON, DC - JULY 4: (AFP OUT) U.S. President Barack Obama, with first lady Michelle Obama delivers remarks to an Independence Day picinic on the South Lawn of the White House on July 4, 2012 in Washington, D.C. On this Independence Day President Obama is hosting a 4th of July celebration picnic on the South Lawn for White House staff and US service members. (Photo by Shawn Thew-Pool/Getty Images)

  • BAUMHOLDER, GERMANY - JULY 04: U.S. soldiers and their families watch fireworks during the 4th of July festivities at the Baumholder U.S. military base on July 4, 2012 in Baumholder, Germany. Baumholder has traditionally been home to the 170th Infantry Brigade, though the unit, which numbers several thousand soldiers and has participated in numerous combat operations in Afghanistan, will be inactivated by the fall of 2012 and its members and their families redeployed, mostly back to the United States. The move is part of a broader cost-cutting effort by the Pentagon, though it does not mean the end for the Baumholder garrison, as other U.S. military units are currently being gradually transferred to it. (Photo by Ralph Orlowski/Getty Images)

  • BAUMHOLDER, GERMANY - JULY 04: Two U.S. flags stick out of a soldier's glasses during the Fourth of July festivities at the Baumholder U.S. military base on July 4, 2012 in Baumholder, Germany. Baumholder has traditionally been home to the 170th Infantry Brigade, though the unit, which numbers several thousand soldiers and has participated in numerous combat operations in Afghanistan, will be inactivated by the fall of 2012 and its members and their families redeployed, mostly back to the United States. The move is part of a broader cost-cutting effort by the Pentagon, though it does not mean the end for the Baumholder garrison, as other U.S. military units are currently being gradually transferred to it. (Photo by Ralph Orlowski/Getty Images)

  • July 4, 2012 - A Chihuahua gets in on the act of showing his patriotism during the annual 4th of July parade in the McKinney, Texas town square. (Michael Prengler/Special Contributor)

  • BAUMHOLDER, GERMANY - JULY 04: A soldier takes part in a watermelon eating contest during the Fourth of July festivities at the Baumholder U.S. military base on July 4, 2012 in Baumholder, Germany. Baumholder has traditionally been home to the 170th Infantry Brigade, though the unit, which numbers several thousand soldiers and has participated in numerous combat operations in Afghanistan, will be inactivated by the fall of 2012 and its members and their families redeployed, mostly back to the United States. The move is part of a broader cost-cutting effort by the Pentagon, though it does not mean the end for the Baumholder garrison, as other U.S. military units are currently being gradually transferred to it. (Photo by Ralph Orlowski/Getty Images)

  • July 4, 2012 - Young parade goers wave at a passing vintage fire truck during the annual 4th of July parade in the McKinney, Texas town square. (Michael Prengler/Special Contributor)

  • A pair of Miniature Schnauzers named Baron and Caesar ride in a wagon pulled by City Council member Herb Weiner during the annual Fourth of July parade Wednesday, July 4, 2012 in Sausalito, Calif. (AP Photo/Eric Risberg)

  • Members of the Native Sons of the Golden West carry a large American flag during the annual Fourth of July parade Wednesday, July 4, 2012 in Sausalito, Calif. The group was founded in 1875 and has preserved many of the landmarks of California's pioneer days, purchasing and rehabilitating them and then donating them to the State or local governments. (AP Photo/Eric Risberg)

  • Re-enactors fire a three-pound cannon and other period weapons in front of George Washington's Mount Vernon home during a Fourth of July event, Wednesday, July 4, 2012 in Alexandria, Va. (AP Photo/Alex Brandon)

  • Re-enactors stand by their three-pound canon as they watch daytime fireworks during a Fourth of July event at George Washington's Mount Vernon in Alexandria, Va., Wednesday, July 4, 2012. (AP Photo/Alex Brandon)

  • Mitt Romney, Ann Romney

    Republican presidential candidate, former Massachusetts Gov. Mitt Romney and wife Ann sit with their family and wave from a trolley at then end of the Fourth of July Parade in Wolfeboro, N.H., Wednesday, July 4, 2012. (AP Photo/Charles Dharapak)

  • Ella Harmon

    Nicolas D'Annunzio, 4, left, and Ian Strother, 5, join the parade of bikes, wagons and scooters decorated for the annual Riverside Citizens Association 4th of July Pancake Breakfast and Children's Parade in Central Riverside Park in Wichita, Kan., Wednesday, July 4, 2012. (AP Photo/The Wichita Eagle, Mike Hutmacher) MAGS OUT AND TV OUT

  • Ella Harmon

    Brilynn Cole, 3, joins the parade of bikes, wagons and scooters decorated for the annual Riverside Citizens Association 4th of July Pancake Breakfast and Children's Parade in Central Riverside Park in Wichita, Kan., Wednesday, July 4, 2012. (AP Photo/The Wichita Eagle, Mike Hutmacher) MAGS OUT AND TV OUT

  • Volunteers raise the large United States flag at the start line before the start of the 43rd annual Peachtree Road Race in Atlanta on Wednesday, July 4, 2012. Peter Kirui of Kenya won the Peachtree Road Race. Kirui's unofficial time of 27 minutes, 36 seconds ties the fourth-fastest time in race history. It is the first Peachtree victory for the 24-year-old. The defending men's champion, Sammy Kitwara of Kenya, finished eighth. (AP Photo/Atlanta Journal-Constitution, Jason Getz) MARIETTA DAILY OUT; GWINNETT DAILY POST OUT; LOCAL TV OUT; WXIA-TV OUT; WGCL-TV OUT

  • Obama Attends Naturalization Ceremony For Active Duty Service Members

    WASHINGTON, DC - JULY 4: U.S. President Barack Obama (L) shakes hands with USMC Lance Cpl. Byron Acevedo as U.S. Citizenship and Immigration Services Director Alejandro Mayorkas and Secretary of Homeland Security Janet Napolitano look on during a naturalization ceremony for active duty service members in the East Room of the White House July 4, 2012 in Washington, DC. Obama welcomed the new citizens on America's 236th Independence Day. (Photo by Roger L. Wollenberg/Getty Images)

  • America Celebrates Its Independence Day

    CENTERVILLE, TX - JULY 4: Carved wooden brids are for sale during an Independence Day parade on July 4, 2012 in Centerville, Texas. This year marks the 236th anniversary of the United States declaring itself independent from Great Britain. (Photo by Jonathan Daniel/Getty Images)

  • America Celebrates Its Independence Day

    CENTERVILLE, TX - JULY 4: A horse-drawn wagon is faetured during an Independence Day parade on July 4, 2012 in Centerville, Texas. This year marks the 236th anniversary of the United States declaring itself independent from Great Britain. (Photo by Jonathan Daniel/Getty Images)

  • Cooks prepare "Stars and Stripes" desser

    Cooks prepare 'Stars and Stripes' desserts, fashioned as the US national flag, for a buffet, on July 4, 2012, before a ceremony for the July 4th Independence Day celebrations at the US Embassy in Paris. AFP PHOTO JACQUES DEMARTHON (Photo credit should read JACQUES DEMARTHON/AFP/GettyImages)

  • Tony Ure, left, decorates his 1928 Bugatti as Beth Parker, right, looks on before driving it in the annual Fourth of July parade on Wednesday, July 4, 2012 in Sausalito, Calif. (AP Photo/Eric Risberg)

  • Ella Harmon

  • Frank Peusch

    Baltimore Gas and Electric (BGE) worker Frank Peusch walks among fallen power lines Wednesday, July 4, 2012 in Baltimore. Hundreds of thousands of people are spending their Fourth of July like America's founders, without electricity, after storms downed lines from the Midwest to the Mid-Atlantic . (AP Photo/Steve Ruark)

  • Mitt Romney

    Republican presidential candidate, former Massachusetts Gov. Mitt Romney greets the crowd as he walks in the Fourth of July Parade in Wolfeboro, N.H., Wednesday, July 4, 2012. (AP Photo/Charles Dharapak)

  • Soldiers in period costume stand during Fourth of July events at George Washington's Mount Vernon estate, Wednesday, July 4, 2012 in Alexandria, Va. (AP Photo/Alex Brandon)

  • Gordon Severance, from left, Nate Eschbach, Julia Eschbach and John Kenton Thompson, of the Freedom chapter of the Sons of the American Revolution, march with the colors during the annual Fourth of July Parade at Market Street Wednesday, July 4, 2012, in The Woodlands, Texas. (AP Photo/Houston Chronicle, Brett Coomer) MANDATORY CREDIT

  • World's Largest Free-Flying American Flag Raised Ahead Of Independence Day

    HOBOKEN, NJ - JULY 03: Crews work to inflate the PNC American Flag balloon in honor of America for Independence Day on the De Baun Athletic Complex at Stevens Institute of Technology on July 3, 2012 in Hoboken, New Jersey. The 53 by 78 foot balloon is the world's largest free-flying American flag, weighs 530 pounds and is being flown in the upcoming 30th annual NJ Festival of Ballooning. (Photo by Michael Bocchieri/Getty Images)

  • Children gather at the staging area of a July fourth parade in Omaha, Neb., Wednesday, July 4, 2012. (AP Photo/Nati Harnik)

  • Children compete in a sack race at Lincoln Park in Valparaiso, Fla. during a Independence Day celebration, Wednesday July 4, 2012. (AP Photo/Northwest Florida Daily News, Nick Tomecek)

  • A few runners watch as volunteers raise the large United States flag at the start line before the start of the 43rd annual Peachtree Road Race in Atlanta on Wednesday, July 4, 2012. Peter Kirui of Kenya won the Peachtree Road Race. Kirui's unofficial time of 27 minutes, 36 seconds ties the fourth-fastest time in race history. It is the first Peachtree victory for the 24-year-old. The defending men's champion, Sammy Kitwara of Kenya, finished eighth. (AP Photo/Atlanta Journal-Constitution, Jason Getz) MARIETTA DAILY OUT; GWINNETT DAILY POST OUT; LOCAL TV OUT; WXIA-TV OUT; WGCL-TV OUT

  • A United States flag waves next to carnival rides as fireworks burst in the air during the Fourth of July Independence Day show at State Fair Meadowlands, Tuesday, July 3, 2012, in East Rutherford, N.J. (AP Photo/Julio Cortez)

  • Banners with the United States flag colors wave as fireworks burst in the air during the Fourth of July Independence Day show at State Fair Meadowlands, Tuesday, July 3, 2012, in East Rutherford, N.J. (AP Photo/Julio Cortez)

  • Ella Harmon

    Emily Judson straps a helmet on son Eli Judson, 4, for the parade of bikes, wagons and scooters decorated for the annual Riverside Citizens Association 4th of July Pancake Breakfast and Children's Parade in Central Riverside Park in Wichita, Kan., Wednesday, July 4, 2012. (AP Photo/The Wichita Eagle, Mike Hutmacher) MAGS OUT AND TV OUT

  • In this photo provided by Trevor Snarr, Dan Snarr, the mayor of the Salt Lake City suburb of Murray, rides with wife, April, on Wednesday, July, 4, 2012, during a parade in which he put all 18 inches of his handlebar mustache up for a vote. He has been growing it for 31 months but says he will shave if a majority of residents voted thumbs-down during the annual Fourth of July parade. (AP Photo/Courtesy Trevor Snarr)

  • Juda Wildrick, 5, plays in a fire hydrant to keep cool during Fourth of July festivities on Wednesday, July 4, 2012, in downtown Philadelphia. This year's holiday brings in a heat wave reaching temperatures in the upper 90s. (AP Photo/Brynn Anderson)