MIAMI-DADE COUNTY, Fla. – An off-duty law enforcement officer shot an armed robber Tuesday night at a CVS pharmacy in southwest Miami-Dade County, police confirmed to Local 10 News.

The gunman entered the CVS on Quail Roost Drive about 7:30 p.m. and tried to rob the store, Miami-Dade police Detective Argemis Colome said.

A customer at the CVS pulled out a gun and shot the man, who then left the area, Colome said. A short time later, a man arrived at Jackson Memorial Hospital with a gunshot wound.

Local 10 News has learned that the customer was a former Miami police officer who currently is an investigator with the Miami-Dade County State Attorney's Office.

A security guard told Local 10 News he heard three or four shots, which pierced an office and a window pane.

A woman told Local 10 News reporter Layron Livingston that she believes the robber sped by her in his getaway car.

"I asked the neighbors across the street what happened. They said there had been a shooting up here at he CVS, and I remembered as I was getting home, I was driving south on 117th Avenue and a car came speeding up the grass on my right," she said.

Colome said police are investigating whether the wounded man at the hospital is the same man involved in the CVS shooting.

No customers or employees were injured during the robbery.