A man was arrested Sunday after allegedly firing at police officers from a house in Queens, cops said.

Cops were responding to an address on 125th Street shortly before 5 p.m. for an alleged domestic incident — when the suspect began shooting at them from the second-story, sources said.

The officers took cover but the gunman continued to fire his rifle from the first floor, according to the sources.

Rodolfo Montiero, 25, was taken into custody after he surrendered, cops said.

Charges against Montiero were pending.