Gardaí were approached by a man wielding a loaded handgun as they attempted to seach a house for drugs in Clondalkin, west Dublin, last night.
Officers from the Tallaght Drugs Unit and local gardaí were carrying out the planned search of the house in Greenfort Crescent when a man jumped out of a car with the gun.
"He produced a gun at the gardaí who identified themselves as armed gardaí," a Garda spokesman said.
As a result the armed man fled the scene and was pursued. He again threatened gardaí with the gun but was overpowered by officers at the scene.
A loaded handgun was recovered and is being examined at the Garda Technical Bureau.
The man (32) was arrested and is being questioned in Tallaght Garda Station under Section 30 Offences Against The State Act. A woman (30), who officers believe was the getaway driver for the man, was also arrested.
The house at Greenfort Crescent was subsequently searched and heroin with a street value of €6,000 was found as well as a quantity of cash.
An 18-year-old man was arrested under the Drug Trafficking Act and is being detained in Tallaght Garda Station, where he can be held for up to seven days.