A 57-year-old Maryland man with a life-threatening heart condition has become the first person in the world to successfully receive a transplanted heart from a genetically modified pig, sparking optimism that similar procedures could save the lives of the thousands of Americans waiting for organs.

David Bennett received the heart Friday at the University of Maryland Medical Center in Baltimore and was doing well, University of Maryland Medicine said Monday in a statement.

Doctors at the hospital and elsewhere had deemed Bennett ineligible for a human heart transplant after reviewing his medical records, leaving the experimental surgery as his “only option for survival,” the statement said. It did not specify what disqualified him.

“It was either die or do this transplant,” Bennett said in a statement the day before the surgery. “I want to live. I know it’s a shot in the dark, but it’s my last choice.”

The Food and Drug Administration granted emergency authorization for the historic procedure on New Year’s Eve through its “compassionate use” provision that allows experimental products to be used outside of clinical trials in cases where the patient has a serious or life-threatening condition.

Bennett had been bedridden for months, hospitalized with arrhythmia — an irregular heartbeat — and connected to a machine to keep him alive, the hospital said.

On Friday morning, surgeons removed the heart from the pig — which was provided by Revivicor, a regenerative medicine company based in Blacksburg, Va. — and put it in a device to preserve it until it was transplanted into Bennett. Video released by the hospital showed the device, a container about the size of a microwave, being brought into the operating room on a cart.

“It’s now nestled in its little preservation chamber waiting for our call to action,” Bartley P. Griffith, the surgeon who did the transplant, said in the video before the surgery.

Skin and heart valves from pigs — which are in some ways biologically similar to humans and primates, making them ideal candidates for transplants — have been successfully transplanted into humans in the past. A type of virus carried in pig cells that could infect human cells had long prevented full organ transplants, but researchers in 2015 successfully used a gene editing technique called CRISPR to remove the virus from the pig cells’ DNA.

The pig whose heart was transplanted into Bennett had three genes “knocked out” that would have caused the organ to be rejected, as well as another gene to prevent excessive growth of the pig heart tissue. Six human genes that induce the organ to be accepted by the recipient’s immune system were inserted.

Griffith said in a statement that the “breakthrough” procedure “brings us one step closer to solving the organ shortage crisis.”

More than 106,000 people are on the organ transplant waiting list in the United States, according to the federal government, which says that 17 people in the country die every day while waiting for a transplant.

Bruce Jarrell, president of the University of Maryland at Baltimore and also a transplant surgeon, said in a statement that he and Griffith began their careers in the “infancy” of organ transplant surgery. “Back then, it was the dream of every transplant surgeon, myself included, to achieve xenotransplantation,” or the transplanting of animal cells, tissues or organs into humans, he said. “It is now personally gratifying to me to see this long-sought goal clearly in view.”

Although doctors at the medical center were pleased that Bennett was recovering well three days after the procedure, the coming days are not without risk. Griffith noted that doctors were “proceeding cautiously.”

In perhaps the most famed attempt at animal-to-human organ transplanting, a heart from a baboon was transplanted into a newborn girl known as “Baby Fae” in 1984. The surgery was seen as a long shot at the time, and fears that the child, Stephanie Fae Beauclair, would reject the heart were realized 21 days later when she died of complications including kidney failure.

Friday’s procedure was the most substantial animal-to-human organ transplant to date, as researchers have in recent years developed the technology to modify genes sufficiently to make successful transplants more likely.

In November, as part of an ongoing study, surgeons at NYU Langone Health transplanted a kidney from a genetically modified pig from the same company as the one used Friday into the body of a person who had died but was “maintained” on life support. They had done the same procedure in September, and last month said both procedures had been successful.

Bennett’s transplant differs in that he could go on to live a healthy life if the healing process goes smoothly. After he recovers, Bennett said, “I look forward to getting out of bed.”