Christine Royles, the South Portland woman who advertised the need for a new kidney on the back window of her car, received a transplant Tuesday morning at Maine Medical Center. The donation had been in jeopardy this spring over legal issues with a fundraising effort designed to defray the costs of the kidney donor, who had never met Royles before agreeing to donate his kidney.

Ashley Dall-Leighton, the wife of donor Josh Dall-Leighton of Windham, said the transplant surgery got underway around 7 a.m. He was out of surgery shortly after 11 a.m., and Royles’ surgery was completed early Tuesday afternoon.

Hospital spokesman Matt Paul said in a prepared statement that the surgery was successful and that doctors “anticipate strong recoveries by both the donor and recipient.”

“Having overcome challenges in this unprecedented process, we are delighted that it resulted in a young woman receiving a lifesaving organ transplant, and enhanced awareness of the need for living donors,” Paul said.

Ashley Dall-Leighton told the Portland Press Herald that as her husband and Royles were being wheeled into surgery, Josh detected Royles’ apprehension.

“He turned to her and said, ‘Don’t worry, it’s going to be OK,’ ” Ashley Dall-Leighton said.

She said Josh has “never been nervous” about the surgery, even as the day approached.

“He’s been so calm, cool and collected over it. He’s only been nervous about Christine, and he has been saying, ‘I hope my kidney works for her,’ ” she said.

Josh Dall-Leighton, 30, a corrections officer at the Southern Maine Re-entry Center in Alfred, saw the sign on Royles’ car last fall and immediately contacted her.

“He saw that sign and said, ‘I need to do this,’ ” his wife said.

Royles, whose kidney failure was caused by an autoimmune disease, was placed on a waiting list of more than 100,000 in need of kidney transplants in 2014, but decided to try to find a donor on her own.

The surgery was almost derailed after a GoFundMe effort raised nearly $50,000 for the couple. The account was set up by a friend of Josh Dall-Leighton with a goal of raising $6,000 to cover expenses for the six weeks he was expected to take off work to recover from the surgery.

But after a story about the transplant was published in the Press Herald and was widely picked up by other media outlets, the donations far exceeded the original goal.

Maine Medical Center put the potential transplant on hold until lawyers could sort out legal and ethical issues regarding the large sum of money. Federal and international laws prohibit the sale of organs, but hospital officials have said it was clear that there was no intent to profit from donating the organ.

Last week the hospital announced that the donation was not a legal impediment, and the surgery would go forward.

“If we didn’t have as strong a voice about this as we did, I don’t believe we would be here right now,” Ashley Dall-Leighton said.

She has said they are considering donating the money to a kidney foundation and the neonatal intensive care unit at Maine Med, where their twins were patients when they were born. They wanted to wait until after the surgery and recovery period to have a true accounting of their expenses – as opposed to an estimate – before determining how much and where to donate, she said.