MIAMI (CBSMiami) – An arrest has been made in a shooting incident Wednesday night when a man opened fire on several undercover Miami-Dade police officers in Perrine.

Miami-Dade Police Director Alfredo “Freddy” Ramirez posted on Twitter that he was relieved that the suspect had been caught.

Police have identified the suspected gunman as 22-year-old Fenqwavious Lopez. He’s been charged with four counts attempted murder of a law enforcement officer and three counts of shooting a deadly missile.

The shooting happened at an apartment complex at Evergreen Street & Homestead Avenue where the police department’s South District Gang Unit and Homicide Task Force were conducting an investigation.

Police said the officers were in their vehicles when they noticed Lopez, who was wanted in another investigation, walking down the sidewalk. Officers in three of the unmarked vehicles turned on their emergency lights pulled in close proximity to Lopez. When they stopped, police say Lopez pulled a gun and started shooting at them.

The officers returned fire and Lopez ran off while continuing to shoot at the officers, according to his arrest report.

“It was a very close call for our officers. Thankfully none of them were injured,” said Detective Artemis Colome the night of the shooting.

(Source: Miami-Dade Police Director Freddy Ramirez)

“Three cars were shot up,” said South Florida PBA President Steadman Stahl. “One of them had four bullets shot into the door. How it missed the officer I don’t know. St. Michael must have been looking out for that officer.”

Miami-Dade Police fear this latest shooting is the beginning of a dangerous trend and pointed to a scene on July 31 when a North Carolina fugitive was killed in a shootout with police. In that instance, an officer’s bulletproof vest was credited with saving his life.