Will Smith said he figured he’d vlog his colonoscopy because it’d be “fun” to show his fans that he was taking care of his health, but the exam took an unexpected turn when his doctor revealed that she found a precancerous polyp that had been removed during the procedure.

“I thought it was fun, I was gonna vlog it, you know?” the "Aladdin" star told Ellen DeGeneres while appearing on her show alongside Martin Lawrence on Wednesday. “So I was like, ‘Oh this’ll be cool. I’m gonna vlog my colposcopy…’ And I do it.”

WILL SMITH REACTS TO 'ALADDIN' CO-STAR MENA MASSOUD SAYING HE CAN'T GET AN AUDITION

A colonoscopy lets the doctor examine the lining of the large intestine for abnormalities by inserting a thin flexible tube into the anus, and advancing it into the rectum and colon. It’s used as a screening test for colorectal cancer, which is the third leading cause of death in the U.S., according to the American Society for Gastrointestinal Endoscopy (ASGE).

Ahead of the colonoscopy, patients are put on a strict diet and cleansing routine to ensure the colon is clean so that the exam can be comprehensive. In addition to screening for cancer, a colonoscopy can be used to investigate unexplained bleeding or other digestive issues.

“So, we do the whole thing and I’m vlogging. And I was like, ‘Hey, it’s time now we’re gonna do – let's do the final piece where the doctor tells me everything,’” Smith said of his experience.

At that point, the doctor informed the 51-year-old was told about the precancerous polyp, which had been removed.

JADA PINKETT SMITH 'LOST' HERSELF IN SUPPORT HUSBAND WILL SMITH'S CAREER, MOM SAYS

“I was like, ‘That’s not funny,’” he told DeGeneres. “And then all of a sudden it turned very real, you know? It was just a good thing that they removed it and it was really great.”

Polyps are abnormal growths in the colon lining that vary in size from a tiny dot to several inches, according to ASGE. It is usually difficult for a doctor to differentiate between a malignant and benign polyp by appearance, so they will usually remove it during the exam.

CLICK HERE TO GET THE FOX NEWS APP

Smith said the unexpected discovery was an important reminder for himself and everyone to take care of their health.

“It is so important to take those health issues very seriously and go,” he told DeGeneres. "And I’m telling you, have yourself checked out! They caught it early. It was done.”