A gunman fatally shot two people at a Central Michigan University residence hall on Friday morning, sending police officers swarming to the campus and setting off a search for the suspect that ended early Saturday with an arrest.

The episode rattled nerves at Central Michigan, where details were released slowly and students were told to take shelter inside dorms and classrooms for much of the day.

Police officers said Friday that they were seeking James E. Davis Jr., 19 and a sophomore. They described him as a person of interest in the shooting and cautioned that he was “armed and dangerous.” The victims were identified as Mr. Davis’s parents, James E. Davis Sr. and Diva J. Davis, both 47. An Illinois state legislator identified the elder Mr. Davis as a police officer in Bellwood, a Chicago suburb.