HAMILTON, Ontario — A judge denied bail Tuesday to a Canadian man accused in a massive hack of Yahoo emails, arguing that he would likely flee if released from jail.

Karim Baratov, 22, has alleged ties to Russian agents and access to significant amounts of cash, making him a serious flight risk if freed on bail, a prosecutor said Tuesday.

Baratov was arrested last month and faces extradition to the U.S. He was indicted in the United States for computer hacking along with three other people, including two alleged Russian intelligence agents.