SAG HARBOR, N.Y. — Jimmy Buffett, whose sun-drenched songs celebrated life by the shore, died of a rare, aggressive skin cancer, according to a statement on his website.

Buffett, 76, had Merkel cell cancer, according to the statement, which was posted after initial news of his death emerged Saturday. The statement also disclosed where the “Margaritaville” singer died: at his home in Sag Harbor, New York, near the Hamptons.

He had been fighting the cancer for four years while continuing to perform, the last time making a surprise appearance in Rhode Island in early July, the statement said. Buffett surprised that small crowd in Rhode Island by joining a band on stage at an intimate outdoor setting. At the end of “It’s 5 O’Clock Somewhere”, Buffett said to the gathering, “It is good to see an audience, let me tell you that.”

Merkel cell carcinoma, as it’s known in medical literature, is very rare and tends to spread quickly, including to parts of the body beyond the skin, according to the federal National Cancer Institute and the Mayo Clinic. Risk factors include a lot of sun exposure, a weakened immune system, a history of other cancers, and being light-skinned and over 50.

In May, when he announced a number of canceled concert dates, the legendary musician wrote a note on his social media accounts that offered some cryptic commentary regarding his health situation.

Buffett conjured an easygoing, sand-between-the-toes lifestyle in songs such as “Cheeseburger in Paradise,” “Changes in Latitudes, Changes in Attitudes” and “Margaritaville.” He built the latter into a brand that encompassed restaurants, clothing, casinos and more.