Actor Hugh Jackman wants others to learn a lesson from his mistakes -- wear sunscreen.

The "X-Men: Days of Future Past" star has been diagnosed with and treated for skin cancer for the third time in under a year, his rep tell E! News.

The 46-year-old actor was previously treated for basal cell carcinoma in November 2013, and in May of this year. The disease is curable if detected early. Jackman's rep says that the actor is on the mend and "all good" now.

Get Breaking News Delivered to Your Inbox

In May, Jackman posted a photo on his Instagram page while he was receiving treatment for his second basal cell carcinoma. He was seen with a bandage on his nose and urged his fans not to "be foolish like me":

Another Basel Cell Carsinoma. All out now. Thanks Dr. Albom and Dr. Arian. PLEASE! PLEASE! WEAR SUNSCREEN! A photo posted by Hugh Jackman (@thehughjackman) on May 5, 2014 at 4:28pm PDT

Despite his third bout with the disease, Jackman appears to be in good spirits. On Thursday, he posted a photo of himself posing with his pet dog, Dali:

Good morning! #Dali A photo posted by Hugh Jackman (@thehughjackman) on Oct 10, 2014 at 5:22am PDT

The "Wolverine" star has been married to Australian actress Deborra-Lee Furness since 1996. The couple have two children together: Oscar, 14, and Ava Eliot, 9.

In October, Jackman took part in the Crotch Grab Challenge to help raise awareness for testicular cancer.

Jackman is known for having a diverse career as a high-profile Hollywood actor and for his turns on Broadway as a singer and dancer. He won the 2004 best actor in a musical Tony Award for his portrayal of gay songwriter Peter Allen in "The Boy from Oz." He is about to make another turn on the Great White Way in the new drama, "The River."

Jackman was nominated for an Oscar and won a Golden Globe for his performance as Jean Val Jean in the 2012 film adaptation of "Les Miserables." During a "60 Minutes" interview with Scott Pelley, Jackman described playing the character as the "role of a lifetime."

Jackman is next set to appear on the big screen in Neill Blomkamp's "Chappie," due out March 6, 2015, and as the pirate Blackbeard in the new Neverland-set "Pan," which comes to theaters on July 17, 2015.

Those wishing to find out about self-exams and basal cell carcinoma detection can learn more here.