Author Brad Meltzer’s works are steeped in history— best-selling thrillers, children’s books,  TV shows, and advice books based on real-life heroes for his children— and they all started with his favorite high school teacher, Ellen Sherman.

So when Meltzer, 45, learned Sherman, 71, needed a life-saving kidney donation, he used his social media network to find a match. On Wednesday, Aug. 26, Sherman and her donor underwent successful transplant surgery.

“The whole process has been such a blessing,” Meltzer told FoxNews.com. “It shows you how beautiful and complex the universe can be, and how rewarding, especially when you give something to someone else.”

Meltzer and Sherman’s story began after Meltzer dedicated his 2013 book, “History Decoded: The 10 Greatest Conspiracies of All Time,” to Sherman, who taught history at  North Miami Beach Senior High School and now works as a psychologist. He’d fallen out of touch with her, but the pair ended up reconnecting  via email. After a while, Sherman revealed she had arterial nephrosclerosis, a progressive kidney disease that she described as putting her brain in a fog. Her kidney had failed, and she needed a new one to survive— would Meltzer be able to share her story with his over 60,000 Facebook followers?

“That’s the very least I can do for this woman,” Meltzer recalled thinking at the time.

In November 2013, he posted on Facebook, and a donor whom Meltzer and Sherman thought was a match stepped forward. The woman traveled to Florida, and, while she was having a kidney biopsy, doctors found cancer. Doctors detected the tumor early and it ended up being benign, but the medical issue rendered the woman unable to be a donor.

“She said, ‘Thank you, Brad, for saving my life.’ and I said, ‘I didn’t save your life, you saved your own life by volunteering to save my teacher,’” Brad recalled.

Undeterred, Meltzer spread the word in October 2014.  When one of his readers reached out, worried that she hadn’t heard back from Sherman, Meltzer initially thought nothing of it but decided to forward it to his teacher. It turned out that that woman, Amy Waggoner, 36, was a match.

“This was this giant game of dominos, where all the dominos have to tumble in the exact perfect way,” he said. “If they don’t, the whole thing stops and halts right there. They just all perfectly tumbled in the right direction.”

Sherman and Waggoner underwent surgery last week, and have been discharged from Jackson Memorial Hospital in Miami and are doing well, Meltzer said. In fact, Waggoner is accompanying Meltzer when he throws the first pitch Friday at Marlins Park, where the Miami Marlins are scheduled to play the New York Mets.

A couple of hours after the surgery, Meltzer saw Sherman.

“She said, already, her cloud had lifted,” he said.

Over a year ago, when Meltzer was writing his newly released book, “I am Helen Keller,” he wasn’t sure whether the search for Sherman’s donor would work out. The book ends: “Go thank a teacher who changed your life. You won’t believe what comes from it.”

Meltzer, Sherman and Waggoner support The Flood Sisters Kidney Foundation of America, which educates people on alternative ways to find a donor for kidney transplantation.