"We celebrate our history, our people, and the heroes who proudly defend our flag," he told a crowd at a rain-soaked Lincoln Memorial in Washington DC.
The "Salute to America" event featured military flyovers and fireworks.
Opponents accused Mr Trump of wasting money and politicising the holiday ahead of his re-election campaign.
The Pentagon has not revealed the cost of the extravaganza, which many believe was inspired by Mr Trump's visit to a Bastille Day parade hosted by French President Emmanuel Macron in 2017.
Some reports say the National Park Service diverted nearly $2.5m (£2m) to cover the cost.
Addressing a crowd that had braved torrential rain and high temperatures, Mr Trump paid homage to the military before introducing separate flyovers for each branch.
He spoke about America's battle for independence and praised the "extraordinary heritage" of the country.
"Together we are part of one of the greatest stories ever told, the story of America," Mr Trump said at the event. Chants of "USA, USA" broke out sporadically as he spoke.
"It is the chronicle of brave citizens who never give up on the dream of a better and brighter future," he continued. "As long as we never stop fighting for a better future... there will be nothing that America cannot do."
The stage at the Lincoln Memorial was draped in flags and there were military vehicles on display nearby. Two 70-tonne Abrams tanks had to stay on a side road as they were too heavy for the memorial's surrounding areas.
The event was open to the public free of charge, apart from a ticketed area for VIPs in front of the memorial. The musical playlist included the Star Wars theme, Hail to the Chief and God bless the USA.
It went ahead largely without incident, although there were minor scuffles outside the White House earlier on Thursday after a flag-burning protest.
Following Mr Trump's speech, many people headed to a scheduled concert on the lawn of the Capitol Building where a fireworks display went ahead despite the rainy conditions.
"Who doesn't love America's birthday?" Andrea Stanford [second from right] beams.
The 58-year-old is one of the "Women 4 Trump" group who travelled for 15 hours from Florida with her friends. All of whom, she revealed, are wearing red, white and blue underwear. Why?
"Donald Trump is redefining the presidency and the commitment to freedom and liberty," she says.
"He's the first president who's kept his promises - economically and militarily," she added, referring to the recent meeting at the DMZ with North Korean leader Kim Jong-un.
Alongside the reflecting pool, where rain drops have been crashing down all afternoon, people from states across this country have filed in. Utah, Indiana and Washington state are all represented, many of them wanting to catch a glimpse of the president.
One African American man from Maryland wore a President Obama hat and said he simply wanted to celebrate the national holiday with his fellow Americans.
Mr Trump was joined by a Pentagon delegation that was led by the highest-ranking US military officer, Chairman of the Joint Chiefs of Staff General Joseph Dunford.
But the service chiefs of the Army, Navy, Air Force and Marine Corps did not attend.
The defence department said in a statement it had received 5,000 tickets from the White House. The White House also distributed VIP tickets to major donors and political appointees, amid reported concerns that empty seats might be visible.
Mr Trump's re-election campaign sent out an email this week encouraging supporters to attend the event. But the Democratic National Committee has been given no tickets.
Mr Trump said in a tweet ahead of the event that the expense "will be very little compared to what it is worth".
Military flyovers alone cost tens of thousands of dollars per hour.
Mr Trump's plans for a military display on Veterans Day in November last year were dropped after defence officials said it would cost about $92m - more than three times the original estimate.
They see the event as an inappropriately partisan display and a misuse of public funds.
US presidential contender Joe Biden and two other Democratic candidates marched instead in Iowa, which kicks off the nomination race in seven months' time.
Senator Bernie Sanders wrote on Twitter: "This is what authoritarians do: Donald Trump is taking $2.5 million away from our National Park Service to glorify himself with a spectacle of military tanks rolling through Washington."
Protesters brought along an inflatable balloon depicting Mr Trump as a baby and were denied permission to use helium to make it airborne.
Harry Truman was the last president to speak before a large crowd on the Washington Monument - in 1951.