MADRID — Ángel Hernández adjusted the purple blanket covering his wife, María José Carrasco, before asking her whether she was ready to die.

“The sooner, the better,” she replied.

On Wednesday, Mr. Hernández released a video of his last conversations with his wife, who had multiple sclerosis, shortly before helping her swallow a deadly substance. He then handed himself in to the police in Madrid and spent the night in custody, appearing the next day before a judge, who released him pending a trial for homicide.

While Mr. Hernández may now face a prison sentence for assisting in his wife’s death, his heart-wrenching recording of their last moments together has put euthanasia and assisted death at the heart of the political debate in Spain, where a national election is scheduled on April 28.

Prime Minister Pedro Sánchez, who leads a minority government, promised on Thursday that he would legalize euthanasia if his Socialist party secured a parliamentary majority. He accused the main opposition parties, the Popular Party and Ciudadanos, of repeatedly blocking any attempt to overhaul Spanish legislation to allow people suffering from terminal illnesses to have what he described as a dignified death.