It started with a Facebook comment.
Chad Avery, a civilian employee at the Pima County Sheriff's Department in Tucson, saw the comment by his former boss and longtime friend, Jim Anderson, who is diabetic and said he needed a kidney.
Avery volunteered to be tested to see if he was a match.
The Arizona Daily Star says that was over a year ago.
The men had to undergo rigorous testing, and Avery needed to lose weight before the surgery. In October, a team of transplant specialists did the surgery at St. Joseph's Hospital in Phoenix. Both men are doing well.
"It really wasn't a big decision for me, being a Christian, I've always been taught that the Lord wants us to help our fellow man, and it being Jim made that a lot easier," Avery told The Associated Press.
Anderson was Avery's boss at the Pima County Detention Center, but he had to retire early because of health issues. The two kept in touch over the years, seeing each other at reunions and calling each other a couple of times a year.
Anderson said his comment about needing a kidney was offhand -- he was just answering another friend who asked how he was.
"It was just such an incredible, incredible, uplift. I mean, the Lord never gifted me with a brother when I was a young man but I feel I've got a brother by blood now," Anderson said at a news conference in Phoenix.