ELIZABETH - A man accused of setting off bombs in New Jersey and New York has made his first court appearance on charges he tried to fatally shoot police officers trying to capture him.

Ahmad Khan Rahimi's attorney pleaded not guilty on his behalf to charges of attempted murder of Linden police officers. Rahimi appeared via video from his hospital bed at University Hospital in Newark.

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

Rahimi is accused of detonating a pipe bomb in Seaside Park just before a Marine charity 5K race, and a pressure cooker bomb in New York City on Sept. 17, injuring 31 people.

A video stream of Rahimi was shown in the courtroom in Elizabeth. Rahimi's head was propped up on pillows. A public defender stood next to him wearing a disposable hospital gown and plastic gloves.

Thursday’s court proceedings were only related to state charges related to the shooting in Linden. 

Rahimi is also facing federal charges related to the bombings. The American Civil Liberties Union is representing him in that case. He has not yet entered a plea on the federal charges.

The Associated Press wire services contributed to this report.