Two Miami police officers are recovering after they were injured in an ambush-style attack during a gang sweep Monday night.

>> Read more trending stories

The officers were conducting surveillance around 10 p.m. outside the Annie Coleman apartment complex near NW 60th Street and 20th Avenue when they were ambushed by two people and shot, Miami-Dade police director Juan Perez said.

John Rivera, president of the Miami-Dade police union, told the Miami Herald that the officers were in an unmarked car when the attack took place. Rivera said six people were involved in the attack.

“They were outnumbered and outgunned,” he told the Herald. “God was watching over them tonight.”

One of the officers was shot in the leg, the other in the arm, the Herald reported.

Maj. Hector Llevat said one of the officers returned fire, but it was not immediately clear whether he hit his assailants. The gunmen were able to elude police and remained at large Tuesday morning.

The officers were not identified, however police told WFOR that they have been with the department for 26 and 11 years, respectively.

They were taken from the scene of the shooting by fellow officers, who pulled them from the “hot zone” into a pickup truck and took them to Miami’s Jackson Ryder Trauma Center.

“They are lucky to be alive,” Perez told WFOR. “It’s been a while since I’ve seen a car hit by so many rounds. A high-powered weapon struck that vehicle and the officers should be counting their blessings today. We certainly are counting our blessings.”

Both officers were listed in stable condition Tuesday morning. Police continued to search for the gunmen responsible for the attack, who are considered armed and dangerous.