Cameron Sprott, 15, of Bonnyrigg, Midlothian, was born with a diseased horseshoe kidney, which doctors recently discovered was functioning at just 10% capacity.
His mother Elaine, 50, tried to donate her own organ but, despite her blood being a perfect match, it was soon discovered that its function was not good enough for the procedure to go ahead.
Cameron's aunt Diane Moffat, 47, stepped in after being inspired by the royal wedding.
She said: "Elaine was devastated at not being able to help Cameron. I pondered on it for a couple of weeks, as I have my own family to think about.
"It was on the day of the royal wedding that I decided to do it.
"I wanted us to go to Cameron's wedding.
"I don't want Cameron or Elaine feeling that they owe me something for the rest of their lives.
"As far as I'm concerned, it's done – finished. If anything had happened to Cameron and I had never tried to help, I couldn't have lived with myself."
Cameron's mother Elaine said: "I would like to say thank you to Diane for what she has done. She's given Cameron a second chance at life."
Ms Moffat, from Dalkeith, underwent her operation at Glasgow's Western Infirmary on the same day as sick Cameron last month, who had suffered chronic kidney failure around the age of 10.
Mrs Sprott added: "My sister had got taken in the morning to have her kidney removed and after Cameron got taken in to Yorkhill, I passed the doctor coming along the corridor with Diane's kidney in a bag.
"It was very surreal."