BOCA RATON, Fla. -- A South Florida fourth-grader is being hailed as a hero after performing the Heimlich maneuver on a choking classmate an exercise he learned by watching TV, WPBF News 25 reported.

Ryan Lim, 10, was sitting next to classmate Maranda Parliment inside the cafeteria at Del Prado Community Elementary School in Boca Raton at lunch Monday when he heard what sounded like a girl choking behind him.

"I was, like, hearing her coughing, and she didn't feel so well, so I turned around when I heard the coughing because she was choking," Lim said.

Parliment, also 10, had gotten a piece of food stuck in her throat.

"My friend gave me a carrot and I was chewing the carrot and I banged my foot on a metal pole and I screamed a little," she told WPBF.

The piece of carrot became lodged inside Parliment's throat and she was unable to get it out.

"I was scared. I thought that the ambulance was going to come," she told WPBF.

That's when Lim came to the rescue.

"I did the Heimlich maneuver and it came out of her mouth," Lim explained.

The Heimlich Maneuver is a process in which a person stands behind the individual who is choking and performs a series of abdominal thrusts to dislodge the offending object from the sufferer's throat. The thrusts lift the diaphragm and force enough air from the lungs to create an artificial cough, according to the American Heart Association's Web site.

Brian Parliment, Maranda's father, told WPBF that he was glad that Lim was so fast to respond to his daughter's plight.

"I find it simply amazing that he was that quick thinking," he said. "Not everybody thinks as fast as young Ryan did."

When asked how he learned to perform the Heimlich maneuver, Lim told WPBF that he had seen it on TV. He also said that doing the right thing was a good reward.

"The best thing is to do good deeds. That's really the reward," Lim said.