The man, aged in his 40s, had earlier assaulted a garda during a drugs raid on a house in the Curragh, Co Kildare.
Officers attached to the Ronanstown Drugs Unit in Dublin were carrying out a planned operation at the house in Martinstown on Thursday night when the incident happened.
The unit recovered heroin with an estimated street value of €80,000 at the scene.
Officers arrested two people, a 19-year-old woman and a 31-year-old man, following the seizure.
A third person produced a slash hook and what appeared to be a container of petrol. The man assaulted one of the gardaí and then barricaded himself in the house.
Local roads were closed and the area was cordoned off. An ambulance and the fire brigade were also called to the scene.
Garda negotiators talked to the man overnight and tried to get him to leave peacefully.
Shortly after 8am yesterday morning, the man agreed to leave his home after consulting with his solicitor. He was brought to Kildare Garda Station.
There was no one else in the house overnight and no one was injured in the incident.
The man was charged with an offence under the Non-Fatal Offences Against the Person Act and is due to appear before Kildare District Court again on April 14.
A garda spokesman yesterday confirmed that two people had been arrested after a planned operation at Martinstown.
“A 19-year-old woman and a 31-year-old man are currently being detained under section 2 of the Drug Trafficking Act in Naas Garda Station after an amount of heroin with an estimated street value of €80,000 was seized.”
He said that as part of the same operation gardaí carried out a planned search of a house in Martinstown.
“Gardaí arrested one man in his 40s who has been charged with an offence under the Non-Fatal Offences Against the Person Act after assaulting a member of An Garda Síochána.
“The man barricaded himself into the house overnight and was arrested this morning shortly after 8am when he surrendered himself to gardaí,” the spokesman said.