A man was taken into custody late Sunday after a nearly six hour long standoff with police in northwest Oklahoma City.

John Cline, 48, was arrested near Western Avenue and Memorial Road. 

Police were responding to a report of domestic assault when they were met by a woman who said that a man inside of the home has hit her. The woman told police the man was drunk and had a gun.

When officers tried to make contact with the man, they said they were immediately met with gunfire. 

"At some point, he opened the window and started firing shots. It's unclear if he was shooting at us or just shooting into the air," said Oklahoma City police Master Sgt. Gary Knight.

According to Knight, it appeared to police that Cline was going to come out and surrender but then he retreated inside.

"He was holding a firearm, he ran back upstairs and refused to come out,” Knight said.  

Police blocked off the area, evacuated neighbors and called in the SWAT team.

About midnight, the man peacefully surrendered to police. He was taken into custody and booked into the Oklahoma County jail.

At the time of the incident, Cline had an active warrant for his arrest.