The man, whose name has not been made public, was shocked to see two pink lines after jokingly taking the test, which had been left in his bathroom cabinet by an ex-girlfriend.
The strange scene was drawn out as a comic and submitted to the website Reddit, where it drew more than 1,300 comments in three days from concerned strangers.
"You may have testicular cancer! Get to an oncologist, tell them you took a pregnancy test and it came out positive," one Redditor wrote.
Sure enough, a trip to the doctor revealed a tiny lump in the man's right testicle, according to the Reddit thread.
Pregnancy tests detect beta human chorionic gonadotropin, a hormone in the blood and the urine produced by the developing placenta. Experts say beta hCG can also signal testicular cancer.
"It turns out a fair number of testicular cancers make the same exact hormone," said Dr. Mark Pomerantz, a genitourinary oncologist at the Dana-Farber Cancer Institute in Boston. "There are very few things in the body that produce beta hCG, and testicular cancer is one of them."
The tumor was caught early, according to the Reddit thread. But the man might have to have his right testicle surgically removed.
"The testicle usually has to come out. But we're lucky with this disease, in that the vast majority of cases -- even if they're caught further along -- are still very curable," said Pomerantz.
The 5-year survival rate for testicular cancer confined to the testicle is 99 percent, according to the American Cancer Society. Even if the disease has spread to nearby lymph nodes and other organs, requiring radiation and chemotherapy, the 5-year survival rate is 72 percent.
"It's one of the only solid tumors that can be reliably cured by even if it has metastasized," said Pomerantz.
While a positive pregnancy test can be a fluky clue, the first sign of testicular cancer is usually a painless lump.
"It's typically spotted by the guy himself," said Dr. Christopher Wood, professor and deputy chairman of urology at the University of Texas MD Anderson Cancer Center in Houston. "We recommend men do self-exam in the shower once a month to make sure there aren't any major changes."
Once a diagnosis of testicular cancer has been made, beta-HCG is a good indicator of the tumor's response to treatment.
"If the patient had elevated levels before surgery, you would expect them to return to normal afterward," said Wood. "If they don't, it means there are residual cancer cells that have to be treated with chemotherapy."