Five people, including three children, escaped injury overnight when shots were fired into their Dublin home.
Gardai from Ballyfermot in west Dublin were called to the scene shortly before 4am and arrested two people in a follow-up operation.
"Uniformed gardai arriving at the scene chased two men and were threatened at gun point to back off.
"A later search of the area by gardai located a sawn-off semi-automatic shotgun and one cartridge," a Garda spokesman said.
Two men were arrested and are being held at Ballyfermot Garda station under the the Offences against the State Act.
The attack was condemned by local Sinn Fein TD and party justice spokesman Aengus Ó Snodaigh who commended the officers involved.
"The fact that these criminals confronted the Gardaí shows that they have no fear of the law or of its officers. That is why Sinn Féin has called for an escalation of the fight against crime," said Mr Ó Snodaigh, who was launching his party's plan for safer Dublin communities.