Washington — President Donald Trump on Wednesday praised the US military for keeping America "safe, strong, proud, mighty and free" and used the Independence Day holiday to thank them for being willing to put their lives on the line in defense of the nation.

"Two hundred and 42 years ago on July 4, 1776, America's founders adopted the Declaration of independence and changed the course of human history," said Trump, addressing hundreds of military families attending a holiday picnic from a balcony overlooking the lawn.

"But our freedom exists only because there are brave Americans willing to give their lives, to defend it and defend our great country," added Trump, who was accompanied by his wife, Melania. "America's liberty has been earned through the blood, sweat and sacrifice of American patriots."

Trump left the White House for several hours on Wednesday morning headed in the direction of the private golf club he owns in northern Virginia. He returned about an hour before he addressed the picnic. A concert and viewing of the fireworks near the Washington Monument is also on the lineup.

Trump was not expected on Wednesday to interview candidates for the Supreme Court, taking a holiday respite from the intense process. He has spoken with seven candidates, according to the White House, and will announce his choice for a successor to retiring Justice Anthony Kennedy on Monday.