Photo by hadsie.

On Friday, a federal judge ruled that a District law preventing the release of inmates from jail between 10:00 pm and 7:00 am is unconstitutional, saying it violates inmates’ rights by keeping them in jail longer than necessary.

Under the law, if your release is ordered but officers don’t finish processing your release paperwork before 10:00 pm, too bad. Sleep tight under lock and key, pal.

U.S. District Judge Royce C. Lamberth called the law “shocking.”

Heeding the advice of its attorneys, the D.C. government stopped enforcing the law in 2009.

Lamberth also ruled that the District government violated the rights of hundreds of inmates by subjecting them to unwarranted strip searches. An attorney for the inmates who filed the class-action lawsuit was pleased by the ruling. Lamberth will rule on damages at a future date.