Emergency services were called to Faulkner Street, Old Toongabbie about 10.30pm last night, after the man allegedly locked himself in his home and began making threats.
Officers called in back-up in the form of the riot squad and a heavily armed four-wheel drive.
Read Related Also: Veep to announce fix to "root causes" of illegal migration
Police negotiated with the 45-year-old for three hours over loudspeaker, which woke up neighbours.
He was arrested and taken to Westmead Hospital, where he is under police guard.