With fighter jets flying overhead, U.S. President Donald Trump praised the military and urged young people to join the armed forces on Thursday in a celebration of Independence Day that critics accused him of turning into a political event.

Trump, a Republican who was inspired to hold the flashy event after seeing a similar display in France, dismissed concerns ahead of the ceremony about the expense and militaristic overtones of the event outside the 97-year-old Lincoln Memorial, a symbol of national unity.

"Our nation is stronger today than it ever was before. It is its strongest now," Trump said from a platform in front of the famous memorial, echoing a theme he uses at campaign rallies. "For Americans, nothing is impossible"

Flanked by Bradley fighting vehicles, Trump steered clear of divisive political rhetoric, in a departure from the majority of his speeches. At times, an enthusiastic crowd chanted: "USA! USA! USA!"

Watch Trump discuss U.S. cultural achievements:

From jazz to the World Series, Donald Trump boasts of U.S. cultural contributions. 0:34

Trump, 73, praised American military might despite having himself avoided the draft during the Vietnam War with bone spurs in his feet. With well-planned choreography, he told stories about each branch to introduce separate fly-overs of military aircraft.

"For over 65 years, no enemy air force has managed to kill a single American soldier. Because the skies belong to the United States of America," he said.

Tributes paid

Separately Trump paid tribute to the U.S. Border Patrol and U.S. Immigration and Customs Enforcement, two agencies that have played leading roles in carrying out his tough immigration policies.

He cited as great Americans both Harriet Tubman and Frederick Douglass, African-Americans who campaigned for the abolition of slavery. His praise was likely to draw fresh criticism as Trump's administration in May decided to keep Tubman's image off the $20 bill. He previously raised doubts about his knowledge of Douglass by speaking of the former slave in the present tense as "somebody who's done an amazing job."

The speech was followed by a concert on the U.S. Capitol lawn at the opposite end of the National Mall. Fireworks would follow the concert, weather permitting.

Watch Trump urge young people to join the military:

In his July 4 speech, the U.S. president makes a military recruiting pitch. 0:14

Thousands of supporters wearing Trump's signature "Make America Great Again" hats, along with opponents questioning the cost of the event, poured into the U.S. capital despite scorching temperatures and intermittent rain, while a diapered "Baby Trump" balloon sat next to a banner calling Trump a traitor.

Protesters burned a U.S. flag in front of the White House.

"People are coming from far and wide to join us today and tonight for what is turning out to be one of the biggest celebrations in the history of our Country," Trump tweeted early on Thursday, seeming to encourage crowds to descend on the monument-lined mall.

Ahead of the speech, Democrats accused the president of staging an out-of-place campaign rally, aware he has a history of veering off script with sharp partisan attacks even at events that are not meant to be overtly political.

Trump supporters and opponents carried American flags and wore red, white and blue outfits.

"I think what Trump's doing with the tanks, all the flyovers, I think it's great," said Brandon Lawrence, his face painted with the colours of the American flag.

Watch Trump discuss the importance of the frontier in U.S. history:

U.S. President Donald Trump speaks on the importance of pushing past boundaries. 0:19

Some at the White House had worried about the crowd size, according to an administration official.

In January 2017, Trump fumed about reports that the crowd at his inauguration ceremony in front of the Capitol was smaller than it was for President Barack Obama.

Perhaps with the crowd size in mind, Trump sent out tweets urging people to attend and saying the wait would be worth it. As it happened, the crowd lined both sides of the reflecting pool in front of the memorial.

Expensive show

Opponents were not impressed.

"This is costing us millions and millions of dollars. We the taxpayers are paying for it, for Donald Trump to use our military as a prop. And that's just not right," said Medea Benjamin, co-founder of the women-led peace group Code Pink.

Republican political groups were given prime tickets for Trump's speech, and the Washington Post reported that the U.S. National Park Service diverted $2.5 million US in park entrance fees to help pay for the event.

Watch Trump praise U.S. military might:

U.S. president discusses military achievements, including the Second World War. 0:35

Democratic presidential candidate Sen. Bernie Sanders weighed in with criticism: "This is what authoritarians do: @realDonaldTrump is taking $2.5 million away from our National Park Service to glorify himself with a spectacle of military tanks rolling through Washington," he wrote in a tweet.

Trump played down the expense.

"The cost of our great Salute to America tomorrow will be very little compared to what it is worth. We own the planes, we have the pilots, the airport is right next door (Andrews), all we need is the fuel," he posted on Twitter on Wednesday. "We own the tanks and all. Fireworks are donated by two of the greats. Nice!" Andrews is the name of a nearby military base.

The July 4 holiday celebrates the U.S. founders' declaring independence from Britain in 1776.