Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Pop star Selena Gomez revealed on Thursday that she recently underwent a kidney transplant because of her battle with the autoimmune disease lupus.

The 25-year-old singer and actress shared the news on Instagram to explain to fans who may have been wondering why she was “laying low” over the summer.

“So I found out I needed to get a kidney transplant due to my Lupus and was recovering. It was what I needed to do for my overall health,” Gomez wrote in her post, which included a photo of herself lying in a hospital bed next to her longtime friend, and donor, actress Francia Raisa.

“There aren’t words to describe how I can possibly thank my beautiful friend,” she wrote. “She gave me the ultimate gift and sacrifice by donating her kidney to me. I am incredibly blessed. I love you so much sis."

Gomez, who also posted a photo of the scar from her transplant surgery in the same Instagram post, promised her fans that she’d reveal more details about her health in the near future.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Selena Gomez posted this photo showing her transplant scar on her Instagram account. @selenagomez/Instagram

“I honestly look forward to sharing with you, soon my journey through these past several months as I have always wanted to do with you,” she said.

The entertainer has been public about her battle with lupus, an autoimmune disease that prompted her to take some time off last year to deal with anxiety, panic attacks and depression.

In 2014, she had chemotherapy to treat the disease.

There are two types of lupus. One form, discoid lupus, only affects the skin. Systemic lupus erythematosus, however, harms the skin, joints, kidneys and brain and may be fatal, according to the National Kidney Foundation.

"Lupus is an autoimmune disease that can, among other things, affect the kidneys," said NBC News medical correspondent Dr. John Torres. "If it causes the immune system to attack the kidneys enough they can fail, requiring dialysis or a kidney transplant."

Systemic lupus causes the body’s autoimmune cells — the defense system which usually protects against disease — to attack tissues and organs like the kidneys, triggering inflammation.

Related: Lupus Patient Makes Antibodies to Fight HIV

No one knows what actually causes lupus, but viral infection and environmental toxins seem to be some of the culprits being studied. It's most common in young and middle aged women, ages 19-60.

Up to 60 percent of people with lupus will develop kidney disease at some point in their lives.

In general, patients who undergo kidney transplants have higher survival rates compared to those who require dialysis, said rheumatologist Dr. Amit Saxena, director of Lupus Clinical Trials at NYU Langone Health. "The major long-term risks are rejection of the transplant and complications from the immunosuppressive medications used to prevent failure, such as infections."

The outlook is good for the singer's new kidney, however. Recurrence of lupus in a transplanted kidney is rare, according to Saxena.

Eun Kyung Kim is a regular contributor for TODAY.com and NBCNews.com. NBC News medical fellow Dr. Shamard Charles contributed to this report.