CHICAGO (CBSNewYork) — A prisoner who escaped from U.S. Immigration and Customs Enforcement agents Tuesday night at John F. Kennedy International Airport has been taken into custody in Chicago, authorities say.

Authorities said Mohamadou Lamine Mbacke, 31, was on his way to be deported back to Senegal when he slipped away from ICE agents, taking off in a taxi cab.

According to the criminal complaint unsealed in Brooklyn federal court, he was strategic in his escape.

“While in the gate area, the defendant asked for and received permission to sit approximately eight to 10 rows away from the deportation officers,” the complaint read in part.

He was no longer in handcuffs, per Transportation Security Administration rules.

“Shortly thereafter, the defendant departed the gate area,” the complaint continued.

After three days on the run, Mbacke was taken into custody at a Starbucks coffee shop near the downtown Chicago Amtrak station Friday, authorities said.

Starbucks employee Zimbo Gessert said he seemed like a well-dressed businessman. When he served the customer a grande blonde roast coffee, he never would have guessed what came next.

“These two men, who looked very casual, approached him. And that’s when I knew they were undercover cops, because suddenly he stands up, they flashed their badges, and all of a sudden like seven cops from the outside come running in and thy surround him,” he said.

“It’s a Starbucks. It’s not supposed to happen,” said manager Angelique Williams. “I came for a regular day of work and I didn’t need the excitement.”

Mbacke entered the United States lawfully in 2005 but violated terms of his status and was ordered deported in September 2015 by an immigration judge.

Authorities described him as a “violent detainee” with previous criminal convictions for multiple weapons and firearms offenses dating back to 2012.

Mbacke will make his first court appearance in Chicago before being brought back to Brooklyn, where he will face prosecution for the attempted escape, CBS2’s Jessica Moore reported.