AMHERST — A second man wanted in connection with an attack in a UMass dorm about a month ago has been arrested. The incidenrt involved two men police said assaulted a student with a BB gun — originally believed to be a pistol.

Shawn T. Wyatt, 22, is being held in Hampden County Jail on a warrant and is expected to be arraigned in Eastern Hampshire District Court on charges of armed robbery, assault and battery with a dangerous weapon and assault and battery, according to the Northwestern district attorney’s office.

Framingham District Court staff said Wyatt turned himself in Tuesday. Wyatt and William McKeown, 19, of Framingham, allegedly entered Pierpont Hall and struck a student in head with a BB gun after a botched drug deal, police said. McKeown was arrested on the same charges Feb. 19 and later released after posting $7,500 cash bail. He is due back in court April 11.