(CNN) The chief justice for New Jersey has ordered the release of hundreds of inmates in county jails by Tuesday "based on the dangers posed by Coronavirus disease 19."

"The reduction of county jail populations, under appropriate conditions, is in the public interest to mitigate risks imposed by Covid-19," New Jersey Chief Justice Stuart Rabner of the New Jersey Supreme Court wrote.

The inmates who may be released are those detained for probation violations, municipal court convictions, disorderly persons offenses and for fourth-degree or petty crimes, the order says.

"This is truly a landmark agreement, and one that should be held up for all states dealing with the current public health crisis," Amol Sinha, the executive director of the ACLU of New Jersey, said in a statement

"Unprecedented times call for rethinking the normal way of doing things, and in this case, it means releasing people who pose little risk to their communities for the sake of public health and the dignity of people who are incarcerated," the statement said.

Inmates who have tested positive for the virus will not be released until the judge determines a plan to isolate them.

"My top priority is the health and safety of ALL New Jerseyans -- including those who are incarcerated," New Jersey Gov. Phil Murphy said in a statement on Twitter.

'We have to take bold and drastic steps'

In a press conference Monday, New Jersey Attorney General Gurbir Grewal said inmates will be released unless there is an objection from a county prosecutor, in which case, there will be a hearing to decide on course of action.

"But to be clear all of these individuals will have to comply with the same stay at home orders that are in effect right now," Grewal said.

And once the public health emergency concludes, Grewal said, the inmates will have to finish their sentences.

"I take no pleasure in temporarily released or suspending county jail sentences," he said. "But this is the most significant public health crisis we face in our state's history. And it's forcing us to take actions that we wouldn't consider during normal times."

"We know and we've seen across the river that jails can be incubators for disease," he said. "So we have to take bold and drastic steps."