A motorcyclist pulled over during a routine traffic stop shot an off duty Broward County sheriff's deputy in the head on Monday, critically wounding him, authorities said.

The deputy was on his way to an undercover operation and was not in uniform when he stopped David Maldonado, 23, of Hollywood. The man fled on foot, then turned around and shot Deputy Maury Hernandez, authorities said.

Hernandez, 28, was in critical condition after he suffered "a serious catastrophic injury to the right side of his head," Sheriff Ken Jenne said.

Maldonado was arrested moments later at a nearby condominium, officials said.

Nearly a dozen officers and rescue workers helped load the deputy onto a stretcher. He was taken to Memorial Regional Hospital where he underwent surgery.

"The next couple of days we're going to have to say a lot of prayers for him," said Jenne, who was at the hospital.

The deputy's brother works with nearby Hallandale Police Department, which also responded to the call, she said.

Investigators closed off a road in the area and were looking for evidence.

Hernandez has worked with the agency since 2002.

Maldonado was charged with attempted first-degree murder and violation of probation. It was not clear why he was on probation. He was being held without bond.