WASHINGTON — The Supreme Court on Wednesday ruled that an Alabama death row inmate who missed a filing deadline thanks to a mix-up in the mailroom of a prominent New York law firm must be given another chance.

Justice Ruth Bader Ginsburg, writing for the majority in the 7-to-2 decision, said “no just system” would allow the missed deadline to be held against the inmate, Cory R. Maples, in light of how he had been treated by lawyers from Sullivan & Cromwell, who handled his case without charge after he was convicted of murdering two people in 1997. The decision allows lower federal courts to consider Mr. Maples’s claim that his trial court lawyers were ineffective notwithstanding the missed deadline in the state court system.

“Maples was disarmed by extraordinary circumstances quite beyond his control,” Justice Ginsburg wrote.

In a concurrence, Justice Samuel A. Alito Jr. described what had happened to Mr. Maples as “a veritable perfect storm of misfortune,” starting with the oddity that much of it was attributable to lawyers from “one of the country’s most prestigious and expensive” law firms.