Surveillance video taken near a shooting in the Bronx shows two plainclothes officers closing in on the gunman and quickly getting him to drop his weapon before arresting him.

Police said the officers were conducting routine patrol in an umarked police vehicle Monday near Featherbed Lane and Nelson Avenue when they heard a gunshot and saw people running.

The officers followed the direction of the gunshot and when they arrived on the scene, saw a man holding a gun and firing another shot, police said.

The man started to leave, and the cops followed him and ran out of the car, video shows.

One of the officers is seen running up behind the man, who appears to be calmly walking, and apparently yelling at him to drop his weapon as he holds up his own gun.

The gunman stops and complies, tossing his gun on the sidewalk and raising his hands. The other officer runs out of the car, and the two descend on the man, taking him to the ground and arresting him.

The 31-year-old suspect, who is from the Bronx, was arrested on several weapons and reckless endangerment charges.

The officers are assigned to the 46th precinct's anti-crime unit.