In his 31-page decision, U.S. District Judge Paul Diamond said there were at least six grounds that required him to reject the Green Party's lawsuit, which had been opposed by Trump, the Pennsylvania Republican Party and the Pennsylvania attorney general's office.
Suspicion of a hacked Pennsylvania election "borders on the irrational" while granting the Green Party's recount bid could "ensure that that no Pennsylvania vote counts" given Tuesday's federal deadline to certify the vote for the Electoral College, Diamond wrote.
"Most importantly, there is no credible evidence that any 'hack' occurred, and compelling evidence that Pennsylvania's voting system was not in any way compromised," Diamond wrote. He also said the lawsuit suffered from a lack of standing, potentially the lack of federal jurisdiction and an "unexplained, highly prejudicial" wait before filing last week's lawsuit.
The decision was the Green Party's latest roadblock in Pennsylvania after hitting numerous walls in county and state courts. Green Party-backed lawyers argue that it was possible that computer hackers changed the election outcome and that Pennsylvania's heavy use of paperless machines makes it a prime target. Green Party presidential candidate Jill Stein also contended that Pennsylvania has erected unconstitutional barriers to voters seeking a recount.
It is part of a broader effort by Stein to recount votes in Michigan, Pennsylvania and Wisconsin. Trump won all three states narrowly over Democrat Hillary Clinton, while Stein captured about 1 percent of the vote, or less, in all three states.
In Pennsylvania, Trump beat Clinton in Pennsylvania by about 44,000 votes out of 6 million cast.
A federal judge halted Michigan's recount last week after three days. The Wisconsin recount was expected to conclude Monday. With about 95 percent of the votes recounted as of Sunday, Clinton had gained 25 votes on Trump, but still trailed by about 22,000.
Associated Press reporter Scott Bauer in Madison, Wisconsin, contributed to this report.
Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.