See video from the surgery at CNN affiliate KTVU-TV.
(CNN) -- Five who desperately needed new kidneys got them Friday in an unusual five-way kidney transplant swap at a San Francisco hospital made possible by a computer program.
"It's just an amazing gift," said April Langstraat, a 65-year-old Selma, California, woman who waited on a transplant list for five years before Friday's surgery.
Alan Langstraat, 62, wanted to give a kidney to his wife, but his organ was incompatible.
Instead, his kidney was transplanted into another patient at California Pacific Medical Center Friday, while his wife received an organ from a stranger who agreed to the swap.
"It's a rare opportunity," Langstraat told CNN affiliate KTVU-TV before a surgeon removed one of his kidneys.
The process was repeated five times Friday, with a live kidney going to someone who had a friend or relative willing to donate an organ that was not compatible for them but was a match for one of the others.
This was the third five-way kidney swap done in the United States, hospital spokesman Kevin McCormick said Sunday. Computer software is becoming increasingly effective in making complex paired donation matches, he said.
"Every time we do one of these kidney paired donations, taking the patients off the waiting list, in a sense, it's another kidney available for somebody who doesn't have a living donor option," said Dr. Steve Katznelson, the medical director of California Pacific's kidney transplant program.
Each recipient and donor agreed to guidelines to prevent "a breakdown along the way," with a donor "suddenly saying 'I changed my mind'" after the surgeries for the first had started, McCormick said.
"Everyone was pretty much in the same boat," he said.
The donors did not know which patient would get their kidneys before the surgery and no one would find out unless each person agreed later.
The procedures, involving 50 doctors, nurses and support staff, began at 7:30 a.m. with the last patient rolling out of surgery 10 hours later, McCormick said.
"They're all doing well," he said Sunday. The transplant results are "very promising," he said.
For the Langstraat family, the paired donation advance has added importance for their future. April Langstraat's daughter Charlotte and son Henry inherited her genetic polycystic kidney disease, which means they expect to need transplants in the future.
Although 83,000 people are on the U.S. waiting list for kidney transplants, the number of live kidney donors declined from 6,647 in 2004 to 6,387 in 2009, according to the National Kidney Foundation.