A woman who pushed a commuter to her death in front of a New York City subway train just days after being released from a psychiatric facility was sentenced Friday to 20 years to life in prison.

Melanie Liverpool, 33, admitted shoving 49-year-old Connie Watton off a subway platform at the Times Square station in 2016 — a harrowing crime that made headlines and tapped into a common fear of New Yorkers.

Liverpool was diagnosed with schizophrenia and bipolar disorder, according to her attorney, Aaron Wallenstein, and had been released from a psychiatric facility just five days before the killing. She pleaded guilty to murder last month.

The Manhattan district attorney, Cyrus R. Vance Jr., condemned the killing as an "unconscionable crime."

"Now, thanks to the NYPD and my office's prosecutors, she will serve significant prison time for this horrific act of violence," Vance said in a statement.

Wallenstein told The Associated Press that his client is remorseful but intends to appeal the sentence. He called the case a "tragedy, no matter how you look at it."

"A woman lost her life and Ms. Liverpool took responsibility," Wallenstein said. "She led an exemplary life until she had these illnesses and issues."

The attack was witnessed by several commuters, including one who followed Liverpool and pointed her out to police officers. When officers asked her what happened, prosecutors said, Liverpool told them she had pushed a person onto the tracks.

The authorities said that Liverpool, before being admitted to the psychiatric ward, falsely claimed to have pushed another woman to her death in front of an oncoming train at Union Square station.

Police deemed that woman's death a suicide, but prosecutors argued in court papers that Liverpool's false claim demonstrated "a motive or reason to commit this otherwise senseless and purposeless crime."

The suicide Liverpool witnessed "helped put in her mind the ideas and thoughts that led to" Watton's killing, Assistant District Attorney David Drucker wrote in a court filing.