The unnamed man was the subject of a comic his friend drew, posted on Reddit.
After the page went viral, a Reddit commenter suggested: "You may have testicular cancer. Get to an oncologist, tell them you took a pregnancy test and it came out positive."
As a result, doctors found a small tumour in the man's right testicle, which was caught early.
The man's friend said afterwards: "I guess there is a hormone the [pregnancy] test picks up that the tumour produces, and that is why the test said he was pregnant.
"Both of us want to say thank you, and in all seriousness, if you are male check yourself for testicular cancer regularly. If you are a girl, test yourself for breast cancer regularly.
"Thank you again, Reddit."
> Woman 'lies about cancer for boob job'
> Woman's cancer may have been fruit seed