The American Civil Liberties Union said on Monday it will temporarily provide legal counsel for the man suspected of detonating a bomb in the heart of New York City that injured 31 people earlier this month, as concern builds over the suspect's lack of access to a lawyer.

Ahmad Khan Rahami, a 28-year-old naturalized U.S. citizen, has been held in police custody in a hospital in Newark, New Jersey, since he was arrested on Sept. 19 following a dramatic gun battle with officers trying to take him into custody.

Rahami faces federal and state charges in New York and New Jersey stemming from the bombing in Manhattan's Chelsea neighborhood two days earlier, and explosives found in two New Jersey locations.

The attacks are being treated by authorities as an act of terrorism. They came days after the 15th anniversary of the Sept. 11 attacks, and after a series of attacks in the United States inspired by Islamic militant groups including al Qaeda and Islamic State.

Federal judges denied requests by public defenders to be appointed to represent Rahami last week, siding with prosecutors who argued he had not officially been arrested by federal authorities.

On Monday, ACLU lawyer Alexander Shalom filed a notice of appearance as counsel for Rahami in federal court in Newark. His filing comes as prosecutors and federal public defenders in New York and New Jersey squabble over when Rahami will get a court-appointed legal counsel.

In a statement on Monday, the ACLU said the U.S. Justice Department and the Prosecutor's Office in Union County, New Jersey, continue to improperly deny Rahami the right to an attorney.

For example, the ACLU also said that the Union County prosecutor prevented Rahami's local public-defense counsel from checking on Rahami's condition because the prosecutor said an arrest warrant had not yet been executed.

"The right of an accused person to have an attorney is a fundamental, undeniable right, regardless of the charges," Shalom, the ACLU lawyer, said in a statement on Monday.

"It's extremely disturbing that Mr. Rahami's lawyers have not been able to verify their client's health condition, including his level of consciousness."

The Union County Prosecutor's Office did not immediately respond to a request for comment. A spokesman for the U.S. Attorney's office in New Jersey declined to comment.

Shalom will represent Rahami on the federal charges until public defenders are able to represent him, the ACLU said.