People who took a single vitamin pill twice a day cut their risk of the two most common forms of skin cancer by nearly a quarter, Australian researchers reported Wednesday. (Tweet This)

The vitamin is a form of vitamin B3 called nicotinamide, and it's sold in grocery and health food stores for just a few cents a pill. It doesn't have some of the unpleasant side-effects of its close relative niacin and it's considered safe to take.

The Australian researchers tested it on 386 people who had already been diagnosed with skin cancer—either squamous cell or basal cell carcinoma. These are extremely common and slow-growing cancers, much less serious than melanoma.

More from NBC News:

Can a Weak Grip Predict Heart Disease?

Ebola Epidemic Slows Even More

More Americans Taking Home $100,000-Plus in Prescriptions



While they are easy to treat, it's inconvenient and can leave scarring. Left untreated, squamous cell carcinoma, especially, can spread and can kill people.

The volunteers took either two 500 mg vitamin B3 pills a day for a year, or a placebo. After a year, those who took the B3 were 23 percent less likely to have another cancer diagnosed, the team reports in a written summary of their findings to be presented next month at the American Society of Clinical Oncology's annual meeting.

"This is the first clear evidence that we can reduce skin cancers using a simple vitamin, together with sensible sun protection. We hope that these findings can be immediately translated into clinical practice," said Diona Damian, a professor of dermatology at the Dermatology University of Sydney who led the study.

"However, people at high risk of skin cancer will still need regular check-ups with their doctor."

Read More Antibiotics: Jim O'Neill thinks we need $2B for new drugs



It's not clear how long the benefit might last.

The American Cancer Society estimates that 2.2 million Americans are diagnosed with basal and squamous cell skin cancers each year. Half of all Australians eventually are diagnosed with one or the other. But only about 2,000 people die from either cancer a year, mostly elderly people who have left the cancer untreated.

The pills also reduced the numbers of pre-cancerous lesions called actinic keratosis. These thick, scaly patches of skin were reduced by 20 percent among the volunteers who took nicotinamide after nine months of treatment.

Nicotinamide is chemically similar to niacin, and when people ingest niacin, the body converts it to nicotinamide. But it can cause unpleasant skin flushing, headaches and low blood pressure. Nicotinamide doesn't.

Read More ASCO cancer research data drop: What to watch



Symptoms of squamous cell skin cancer include persistent thick, rough or scaly patches on the skin that can look like warts and that can crust over or bleed. It can also also look like an elevated bump with a depressed center that may bleed.

These patches can also occur in the mouth or on the bottom of the foot.

Risks include ultraviolet rays from sun exposure and tanning beds, having light skin, being older, and having an immune system weakened by drug treatment or disease. Men are far more likely than women to develop squamous cell carcinoma.

Read More California Obamacare cuts, threats to Hawaii 's exchange



The researchers think nicotinamide works to prevent skin cancer in two ways, by helping repair DNA damage caused by ultraviolet light, and by protecting the immune system.

Many people have tried to show that vitamins might prevent various forms of cancer, but studies have shown they often do not. And some supplements, such as beta carotene, may actually fuel cancer.

Some exceptions: a study that showed a specific multivitamin reduced men's risk of cancer. Another showed a certain form of vitamin C might enhance chemotherapy.