Amid criticism of his handling of the pandemic, he said China – where the virus originated – must be “held fully accountable”.
The president also berated protesters who toppled monuments of US leaders at recent anti-racism protests.
“Their goal is demolition,” he declared.
In a combative tone that echoed his Friday night speech at Mount Rushmore in South Dakota, the president pledged to defeat the “radical left, the Marxists, the anarchists, the agitators, the looters”.
He spoke from the White House lawn, flanked by his wife Melania, to a crowd that included US soldiers and frontline medical staff.
Praising “our nation’s scientific brilliance,” Mr Trump said the US “will likely have a therapeutic and/or vaccine solution long before the end of the year”.
The head of the World Health Organization, Tedros Adhanom Ghebreyesus, warned in June that scientists may never be able to create an effective vaccine against the coronavirus, observing: “The estimate is we may have a vaccine within one year. If accelerated, it could be even less than that, but by a couple of months. That’s what scientists are saying.
The US has the world’s highest number of coronavirus deaths and infections, and confirmed more than 43,000 new Covid-19 cases in 24 hours on Saturday, according to figures from Johns Hopkins University. Florida, where the outbreak is especially acute, saw 11,458 new cases.
The president made no reference to the nearly 130,000 US deaths linked to the pandemic.
His comments were followed by a military flyover involving various aircraft, including B-52 bombers and F-35 fighter jets.
A massive firework display was later held in Washington DC, watched by spectators who gathered on the National Mall.
Ahead of Mr Trump’s speech, Black Lives Matter protesters gathered outside the White House – the scene of many recent anti-racism demonstrations in the wake of George Floyd’s killing in police custody.
Addressing America’s coronavirus battle, the president said his administration had “made a lot of progress” and “our strategy is moving along well”, despite the nationwide surge in infections.
Mr Trump, who faces re-election this year and appears keen to fire up his conservative base with appeals to nationalism, accused China of trying to conceal the virus outbreak – a charge Beijing denies.
“China’s secrecy, deceptions and cover-up allowed [the virus] to spread all over the world,” he alleged.
How did the US mark 4 July?
Many 4 July events were cancelled on public health grounds, with beaches in Florida and California closed, city parades cancelled and firework displays curtailed.
Joe Biden, the Democratic Party rival to Mr Trump in this year’s presidential election, tweeted that “this Fourth of July, one of the most patriotic things you can do is wear a mask”.
Firework displays are a traditional highlight of 4 July, but an estimated 80% of cities and towns have cancelled their shows.
New York City usually holds an hour-long extravaganza, but this year it was replaced by five-minute displays through the week, organised by Macy’s department store, with a final televised one on Saturday – all at undisclosed locations.
Major League Baseball cancelled its 2020 All-Star Game for the first time since World War Two.