Derek Gallo, 33, was taken into custody without anyone getting hurt.
Police say Gallo opened fire from the second floor window of an 84th Street home when officers responded just after 1:30 a.m.
Gallo fired eight shots from a front window, striking two police cruisers and a car belonging to a neighborhood resident.
No one was struck, and the responding officers did not return fire.
During an ensuing standoff, Gallo threw a chair, a sneaker, a lamp, a T-shirt and a 25-pound bag of plaster of Paris at the officers.
After about an hour, Gallo dropped his 9mm Glock onto the window ledge, and it was taken by police.
He then was arrested without incident and taken to a nearby hospital for psychiatric evaluation.
He was charged with numerous counts of attempted murder of a police officer.