WASHINGTON - President Barack Obama, marking his final Fourth of July in the White House, said freedom isn't something that "just happens" but must be defended every single day.

Obama said it's important that people remember what "a miracle" the U.S. is and how "incredibly lucky we are that people generations ago were willing to take up arms and fight for our freedom."

"Independence is not something that just happens," he said during brief remarks to several hundred people in the White House East Room after rain forced cancellation for the second straight year of an annual barbecue on the South Lawn for some 5,000 military service members, veterans and their families.

Get Breaking News Delivered to Your Inbox

"It's something that we have to fight for every single day," Obama said. "It's something that we have to nurture and we have to spread the word and we have to work on."

Freedom involves respecting each other and recognizing the hardships faced by fellow citizens, such as hunger and unemployment, said Obama, who spoke after about an hour's worth of hip-shaking musical performances by rapper Kendrick Lamar and singer-songwriter Janelle Monae.

Monae closed her set by performing "Let's Go Crazy" in tribute to Prince, who died this year.

Obama had another birthday to celebrate: His oldest daughter, Malia, turned 18. He led the audience in singing "Happy Birthday" to her, saying "it's a job of a father to embarrass his daughter."