Selena Gomez was out of the spotlight a lot this summer, but it turns out she had a very good reason.

The 25-year-old actress and singer, who suffers from Lupus, opened up about her health in an Instagram post Thursday. In it, she revealed that she received a kidney transplant several months ago, thanks to some talented doctors and an incredibly generous friend. The donor was fellow actress Francia Raisa, who played Adrian in "The Secret Life of the American Teenager."

Gomez was quick to express her gratitude. She thanked Raisa for "the ultimate gift and sacrifice" in her post and shared a touching photo of them two of them holding hands in neighboring hospital beds. Wrote Gomez:

I'm very aware some of my fans had noticed I was laying low for part of the summer and questioning why I wasn't promoting my new music, which I was extremely proud of. 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. 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. Until then I want to publicly thank my family and incredible team of doctors for everything they have done for me prior to and post-surgery. And finally, there aren't words to describe how I can possibly thank my beautiful friend Francia Raisa. She gave me the ultimate gift and sacrifice by donating her kidney to me. I am incredibly blessed. I love you so much sis. Lupus continues to be very misunderstood but progress is being made. For more information regarding Lupus please go to the Lupus Research Alliance website: www.lupusresearch.org/ -by grace through faith

I'm very aware some of my fans had noticed I was laying low for part of the summer and questioning why I wasn't promoting my new music, which I was extremely proud of. 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. 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. Until then I want to publicly thank my family and incredible team of doctors for everything they have done for me prior to and post-surgery. And finally, there aren't words to describe how I can possibly thank my beautiful friend Francia Raisa. She gave me the ultimate gift and sacrifice by donating her kidney to me. I am incredibly blessed. I love you so much sis. Lupus continues to be very misunderstood but progress is being made. For more information regarding Lupus please go to the Lupus Research Alliance website: www.lupusresearch.org/ -by grace through faith

A post shared by Selena Gomez (@selenagomez) on

It sounds like both women are recovering well and Gomez certainly knows she is lucky to have such a selfless friend. In a post of her own, Raisa shared that the experience changed her life as well and promised that they will share more of their story soon.

We look forward to hearing it!