MILWAUKEE (Reuters) - Donald Trump won a major legal victory on Monday when a federal judge dismissed one of the criminal prosecutions against him, as he prepared to accept the Republican Party's presidential nomination just days after surviving an assassination attempt.

A U.S. judge in Florida appointed to the bench by Trump dismissed the case that accused the former president of illegally holding on to classified documents after leaving office, ruling that the prosecutor handling the case was unlawfully appointed to his role.

The news comes at outset of the 2024 Republican convention in Milwaukee, where Trump will announce his vice presidential pick and on Thursday is due to formally accept the party's nomination to challenge Democratic President Joe Biden in the Nov. 5 election.

Trump, 78, and Biden, 81, are locked in what opinion polls show to be a tight election rematch. Trump continues to falsely claim that his 2020 loss to Biden was the result of widespread fraud and has not committed to accepting the results of the election were he to lose.

The race was upended on Saturday when Trump was shot in the ear at a rally in Pennsylvania by a 20-year-old gunman whose motive remains unknown.

In the wake of his near-death experience, Trump said he is revising his acceptance speech to emphasize national unity, rather than highlight his differences with Biden.

"This is a chance to bring the whole country, even the whole world, together. The speech will be a lot different, a lot different than it would've been two days ago," Trump told the Washington Examiner.

Trump said that following the judge's decision on Monday dismissing the documents case, his other outstanding prosecutions should also be thrown out. He is still awaiting trial on two cases -- a federal prosecution in Washington and a Georgia state prosecution -- for his attempts to overturn his 2020 election defeat.

The July 1 Supreme Court ruling that he has immunity for many actions he took as president could hamstring both those cases.

Trump is also due to be sentenced in New York in September for trying to cover up a hush-money payment to porn star Stormy Daniels in the weeks before his 2016 election victory.

"This dismissal of the Lawless Indictment in Florida should be just the first step, followed quickly by the dismissal of ALL the Witch Hunts," Trump said on his Truth Social site on Monday, also referencing the prosecutions of hundreds of his supporters who stormed the U.S. Capitol on Jan. 6, 2021.

NO PLACE FOR VIOLENCE

Biden is trying to bring the temperature down after months of heated political rhetoric.

"There is no place in America for this kind of violence, for any violence ever. Period. No exceptions. We can't allow this violence to be normalized," he said of the assassination attempt in a televised address from the White House on Sunday.

The shooting on Saturday whipsawed discussion around the presidential campaign, which had been focused on whether Biden should drop out following a halting June 27 debate performance.

Nearly two dozen of Biden's fellow Democrats have called on him to end his reelection bid and allow the party to pick another standard bearer. That debate has been placed on hold in the wake of Saturday's shooting.

The focus this week will be squarely on Trump.

Having consolidated party control, Trump could seize on the prime time opportunity to deliver a unifying message or paint a dark portrait of a nation under siege by a corrupt leftist elite, as he has done at times on the trail.

Trump has frequently turned to violent rhetoric in his campaign speeches, using the word "bloodbath", labeling his perceived enemies as "vermin" and "fascists," and accusing Biden without evidence of a conspiracy to overthrow the United States by encouraging illegal immigration.

Biden has often warned that a Trump victory in November would erode the United States' democratic system. Some Republicans say those comments helped create the conditions for the shooting.

Investigators say they have been unable to identify an ideology that may have inspired 20-year-old Thomas Matthew Crooks to shoot at Trump from a rooftop outside a campaign event.

Biden ordered an independent review of how the gunman, who was shot dead by agents moments after opening fire, could have come so close to killing or severely wounding Trump despite the heavy security provided by the Secret Service at Saturday's event in Butler, Pennsylvania.

The FBI said that Crooks' social media profile contained no threatening language, nor had they found any history of mental health issues. They said he acted alone.

Crooks worked as a nursing home aide near his hometown of Bethel Park, Pennsylvania. He graduated high school with a reputation as a bright but quiet classmate. His guidance counselor described him as "respectful" and said he never knew Crooks to be political.

(Reporting by Gram Slattery in Milwaukee and Andrew Goudsward in Washington, additional reporting by Tim Reid and Nathan Layne in Milwaukee and Sarah N. Lynch in Washington,; Writing by Andy Sullivan; Editing by Scott Malone and Alistair Bell)

By Gram Slattery and Andrew Goudsward