Police officers have to be prepared for anything but Det. Mark Rubins did not anticipate putting his training to the test during this week’s New York Police Academy graduation ceremony.

With recruits gathered at Madison Square Garden Wednesday, Rubins heard a commotion from the family of one of the graduates, Officer Leonardo Escorcia, because his 1-year-old son had started choking.

Rubins, who is also a paramedic, and Lt. Greg Besson rushed to the child.

“It was just, grab the kid and kind of do anything you could at that point,” Rubins told ABC News. “You saw him limp, you knew as you were going up the stairs what the game plan was. You just kind of go with your training and it kicks in.”

Rubins said he was running on adrenaline in the seconds it took him to reach the child, grab the boy and clear his airway by patting the child’s back, successfully dislodging what turned out to be popcorn stuck in his throat. The whole ordeal lasted less than two minutes.

“I'm just happy that he was in good hands when this happens and that Det. Rubins was there,” Escorcia said. “He just jumped into action.”

Officer Escorcia’s wife, Lillian, said she now plans to take CPR classes, something Rubins said every parent should do.

"Everyone should be learning CPR. It can happen anywhere, any time. It's certainly something that anyone who's going to be around children should take, especially for choking hazards. People should learn from that,” Rubins said.