LONDON (Reuters) - WikiLeaks founder Julian Assange was denied bail on Wednesday by a British judge who said he might flee justice while the United States tries again to secure his extradition, a decade after he enraged Washington by publishing troves of secret documents.

Assange had asked to be freed on bail after the judge ruled on Monday that he should not be extradited because he would be at risk of suicide.

But Judge Vanessa Baraitser refused that request, citing the seven years he spent holed up in the Ecuadorean embassy in London after an earlier flight from justice in 2012.

"I am satisfied that there are substantial grounds for believing that if Mr Assange is released today he would fail to surrender to court to face the appeal proceedings," she told London's Westminster Magistrates Court.

Assange, 49, wearing a navy suit, showed no reaction.

Baraitser said the United States, where Assange faces 18 criminal charges of breaking an espionage law and conspiring to hack government computers, had to be allowed to challenge her decision to reject extradition.

That appeal could take months, ensnaring Assange - who has been in prison since being dragged out of the embassy in 2019 - in yet more legal wrangling.

Assange's fiancee, Stella Moris, with whom he had two children while in the embassy, said the judge's decision to deny him bail was a huge disappointment and urged the United States to pardon him. WikiLeaks said it would appeal against the denial of bail.

Admirers hail Assange as a hero for exposing what they describe as abuses of power by the United States. But detractors cast him as a dangerous figure who has undermined the security of the West, and dispute that he is a journalist.

WikiLeaks published hundreds of thousands of secret U.S. diplomatic cables that laid bare often critical U.S. appraisals of world leaders, from Russian President Vladimir Putin to members of the Saudi royal family.

Assange made international headlines in early 2010 when WikiLeaks published a classified U.S. military video showing a 2007 attack by Apache helicopters that killed a dozen people in Baghdad, including two Reuters news staff.

FREEDOM FOR ASSANGE?

Clair Dobbin, a lawyer representing the United States at the hearing, said Assange had gone to extraordinary lengths to avoid extradition and that he could try to leave the United Kingdom to flee justice.

"This court should be in no doubt as to Mr Assange's resources, abilities and sheer wherewithal to arrange flight to another country," Dobbin said. "This court should be under no illusion either as to the readiness of other states to offer Mr Assange protection."

Assange's lawyer, Edward Fitzgerald, said it was not certain U.S. President-elect Joe Biden would continue to pursue Assange's extradition. He added that Baraister's extradition decision "changes everything" and consigned to history the risk Assange would flee rather than stay in the United Kingdom with his young family.

Assange would have lived at a London address with an electronic tag if freed, his lawyer said.

After leaving the Ecuadorean embassy, Assange was jailed for breaching British bail conditions and his supporters forfeited sureties of 93,500 pounds ($127,076). He had sought asylum there to avoid extradition to Sweden, where he was wanted for questioning over alleged sex crimes.

Judge Baraitser said Assange had boasted of helping U.S. spy agency contractor Edward Snowden to flee justice.

Snowden fled the United States and was given asylum in Russia after leaking secret files in 2013 that revealed vast domestic and international surveillance operations carried out by the U.S. National Security Agency.

Dobbin said the United States would appeal the decision not to extradite Assange. She said his mental health issues were not as severe as his legal team had made out and that the ruling had set too high a bar, as no state could completely eradicate suicide risks.

"The court has discharged Mr Assange on a single ground, that of his mental health. It is a decision that hangs on a single thread," Dobbin said.

(Editing by Guy Faulconbridge, Catherine Evans and Alex Richardson)