A food truck driver shot two people during an armed robbery in northwest Miami-Dade Tuesday morning, authorities said.

The incident started around 10 a.m. when an armed suspect approached the truck in the area of Northwest 35th Avenue and Northwest 65th Street and pointed a gun at a woman inside, demanding she hand over money and get on the ground, Miami-Dade Police said.

The driver of the truck heard the commotion and came around and encountered the suspect, who pointed the gun at the driver. The driver was handing money over to the suspect when he somehow was able to arm himself and shoot at the suspect, police said.

The injured suspect tried to flee the scene but was tackled by a Good Samaritan and held down until officers arrived at the scene, police said.

Meanwhile, two people who were in a nearby car started firing at the food truck and the driver fired back, hitting one of them, police said. The people in the car drove to Jackson Memorial Hospital, where one of them was being treated and the other was being questioned, officials said.

"We are very fortunate that this incident was not any more tragic than what it turned out to be. This is not something that we condone and we don't ask anybody in the community to do this," Miami-Dade Police Det. Angel Rodriguez said. "Please do not confront any individual that is armed."

Police said they're trying to determine the connection between the initial robbery suspect and the two people who were in the car.

The food truck driver wasn't injured. A firearm believed to have been dropped by the first suspect was recovered at the scene, police said.

Wild shootout at NW 35th Ave. and NW 65th St. Suspect holds up two workers in a food truck and demands money. One of those workers arms himself and shoots the suspect. Two men in a nearby car hear this & open fire on food truck. Worker returns fire, hitting one of the men @nbc6 pic.twitter.com/a6haOFFWTA — Dan Grossman (@Dan_Grossman) January 29, 2019

The incident remains under investigation.