In the law library of the Cook County jail in Chicago, the chase was on. Detainee Emmanuel Garcia frantically moved his king around a virtual chessboard, losing one piece after another as his opponent closed in.

Just when it seemed all was lost, the timer hit zero, ending the game in a draw. A dozen other men dressed in tan jail scrubs applauded: The result helped the team of detainees defeat a band of Brazilian prisoners they were playing over the internet.

Garcia, though, thought he should have done better.

"I made a couple mistakes," said the 33-year-old. "I tried to give him a sacrifice and get an advantage, but he predicted it, so it didn't work. Because of that, I had to change my whole game."

So it went in the first international chess tournament for inmates, pitting Cook County against prisoners in six countries, including Russia, Armenia, Belarus, Italy and England. The matches will continue until a champion is crowned.

The players sat at tables furnished with laptop computers and small American flags, making their moves electronically as Mikhail Korenman, who teaches the jail's chess classes, coordinated with his counterparts over a balky Skype connection.

The tournament is the latest development in the jail's chess program, founded seven years ago with the help of Russian grandmaster Anatoly Karpov. About 120 detainees take classes in the game, and 15 of the best were invited to take on the world in the two-day event conducted under the auspices of FIDE, the governing body of international chess competition.

The games were played on the platform with a 15-minute time limit. Antoine Thorne, 29, of Chicago, was playing a close match against a Brazilian opponent when his rival gave him a golden opportunity, neglecting to move his queen out of danger.

Thorn immediately saw the mistake and pounced, capturing the queen and making checkmate inevitable.

"He didn't have no way out, man," Thorne said. "It was over with from there."

Korenman said that's the kind of vision he's trying to instill in his players.

"The winner of the chess game is not the one who calculates [his own moves] better — it's the one who calculates what his opponent will do," he said. "If I can figure that out, I can win. I will be one step ahead."

He noted that a study in Brazil found that chess-playing prisoners were less likely than others to return to incarceration, an advantage, he said, that could be related to the game.

"It teaches them a different way of thinking," he said.

Thorne gets it. "They always compare chess to the game of life," he said. "If you make good decisions, it's ultimately going to lead to a good outcome. You make bad decisions, it's going to lead to bad position, and you're going to lose the game."

That said, some members of the jail's chess team are awaiting trial on charges, such as murder, that could keep them incarcerated for decades. But Sheriff Tom Dart said the game should help them, too.

"Anybody will tell you that when you keep people busy, [they're] less likely to be engaged in bad behavior," he said. "This has that effect of keeping people engaged. They now have a skill. There will be other people to play with, or they can play matches by themselves. It will keep their minds on something."