TORONTO -- A Canadian accused in a massive hack of Yahoo emails will have to stay in custody as he prepares to fight extradition to the United States.

Lawyers for Karim Baratov said Friday the 22-year-old's bid to contest a judge's decision to deny him bail has been dismissed.

In his April ruling, Ontario Superior Court Justice Alan Whitten found the young man was too much of a flight risk to be released on bail.

The judge also said Baratov's parents -- who offered close to $1 million in cash and assets as collateral -- would not make suitable supervisors because they had not questioned his growing wealth or his business activities while he was living with them.

Whitten further said he believed Baratov would be motivated to flee, given that he could face up to 20 years in prison if convicted in the U.S.

At an appeal hearing erlier this week, Baratov's lawyers argued that Whitten made several errors, including amplifying the Hamilton man's alleged connection to the Yahoo hack and the Russian intelligence agent who allegedly hired him.

His legal team said in court that there's no evidence to suggest Baratov was involved in the large-scale breach of Yahoo security systems.

Emails between Baratov and his alleged contact in the Russian intelligence service show he was only allegedly hired to hack into 80 accounts, and only allegedly succeeded in accessing seven, they said.

Baratov was arrested in March under the Extradition Act after U.S. authorities indicted him and three others -- two of them allegedly officers of Russia's Federal Security Service -- for computer hacking, economic espionage and other crimes.

His lawyer Amedeo DiCarlo says they will now focus their efforts on challenging the extradition order.