TRENTON, N.J. -- A man accused of setting off bombs in New Jersey and New York, injuring more than 30 people, has been moved from a hospital to a state prison.

Ahmad Khan Rahimi was transferred to a state facility on Tuesday instead of a county jail for his safety and security, New Jersey Corrections Department spokesman Matt Schuman said. Schuman would not identify the facility.

The Afghan-born U.S. citizen had been hospitalized with gunshot wounds following a police shootout that led to his capture in Linden on Sept. 19.

He remains held on $5.2 million bail.

Rahimi, 28, has pleaded not guilty to five counts of attempted murder of a police officer and weapons offences.

During a video court appearance on Oct. 13, he was read his rights by Judge Regina Caulfield and answered "yes" in a faint voice to a series of questions.

He is accused of detonating a pipe bomb along the route of a scheduled Marine Corps charity race in the New Jersey shore town of Seaside Park and a pressure cooker bomb in New York City on Sept. 17. No one was injured in the New Jersey blast, and 31 people were hurt in the New York blast. A second pressure cooker bomb did not explode.

Rahimi has not made court appearances on federal charges in either state.