A man on parole for robbery allegedly robbed an off-duty Chicago police officer Thursday in a South Loop parking garage, but was tackled by the officer who threw his car keys to distract him, prosecutors say.

Isaias Saucedo-Ugalde, 21, allegedly followed the officer up an elevator to the third floor of a parking garage in the 700 block of South Wabash Avenue, Cook County prosectors said in a Friday bail hearing.

As the 22-year-old officer was about to enter his car at 7 p.m., the man tapped the officer’s shoulder and tucked his hand into his pocket to imply he was armed, prosecutors said.

“Give me your f—— keys; I have a gun; I will shoot you,” he allegedly told the officer, according to prosecutors.

The officer replied, “Are you serious?” prosecutors said.

The officer then threw his keys to the man, distracting him and made an emergency takedown, prosecutors said. The officer held the man at gunpoint on the ground until other officers arrived and arrested Saucedo-Ugalde.

Saucedo-Ugalde was not armed, but officers did find a 6-inch white tube in his pocket, Chicago police said.

The officer had been staying at the nearby Hotel Essex, which has been housing first responders during the COVID-19 pandemic.

Saucedo-Ugalde is charged with a felony count of aggravated robbery indicating he had a firearm.

Cook County Judge John Lyke Jr. set his bail to $250,000, with electronic home monitoring as a condition of release, prosecutors said. He is due in court again May 1.

At the time of the attack, he was on parole for two armed robbery convictions from 2018 and 2016, prosecutors said.

Read more on crime, and track the city’s homicides.