Some 911 calls in Manhattan will now bring out two ambulances, one hurrying to the scene and one lagging slightly behind.

The first one will try to save the patient’s life. The second one will try to save the patient’s kidneys, in case the first ambulance fails.

After months of grappling with the ethical and legal implications, New York City medical officials are beginning to test a system that they hope will one day greatly increase the number of organs collected for transplant.

For five months starting Wednesday, the city will deploy a specially trained team that will monitor 911 calls for people who may be in danger of dying, like those having a heart attack. If efforts to resuscitate the patient fail, the team will quickly move in and try to save the kidneys; normally, patients who die outside hospitals cannot be donors because if too much time passes after the heart stops beating, the organs are unusable.