Justice Sandra Day O’Connor, the first woman to serve on the Supreme Court, has been diagnosed with the “beginning stages of dementia, probably Alzheimer’s,” she said Tuesday.

O’Connor revealed her diagnosis in a letter to the nation distributed by the Supreme Court, writing that doctors diagnosed her “some time ago.”

“As this condition has progressed, I am no longer able to participate in public life,” she wrote. “Since many people have asked about my current status and activities, I want to be open about these changes, and while I am still able, share some personal thoughts.”

O’Connor, 88, was nominated to the Supreme Court by then-President Ronald Reagan in 1981 and confirmed by the Senate unanimously.

O’Connor served on the court for 25 years and retired in 2006 to help take care of her husband, John, who was diagnosed with Alzheimer’s.

During her 25 years on the bench, she often served as the court’s swing vote. In 1992, she joined Justices David Souter and Anthony Kennedy to write the majority opinion in the case Planned Parenthood v. Casey, which reaffirmed Roe v. Wade. O'Connor also cast key votes in legal disputes involving affirmative action and campaign finance, as well as the 2000 case Bush v. Gore.

After she left the bench, O’Connor started iCivics, an organization designed to promote civic education among students.

“I can no longer help lead this cause, due to my physical condition,” O’Connor wrote in her letter. “It is time for new leaders to make civic learning and civic engagement a reality for all. It is my great hope that our nation will commit to educating our youth about civics and to helping young people understand their crucial role as informed, active citizens in our nation.”

O’Connor said she will continue living in Phoenix, Ariz.

“While the final chapter of my life with dementia may be trying, nothing has diminished my gratitude and deep appreciation for the countless blessings in my life,” she wrote. "How fortunate I feel to be an American and to have been presented with the remarkable opportunities available to the citizens of our country. As a young cowgirl from the Arizona desert, I never could have imagined that one day I would become the first woman justice on the U.S. Supreme Court."

Chief Justice John Roberts said that while O'Connor is withdrawing from public life, "no illness or condition can take away the inspiration she provides for those who will follow the many paths she has blazed."

"Justice O’Connor is of course a towering figure in the history of the United States and indeed the world," Roberts said. "She broke down barriers for women in the legal profession to the betterment of that profession and the country as a whole. She serves as a role model not only for girls and women, but for all those committed to equal justice under law."

[Opinion: Democrats: Treat Brett Kavanaugh the same way you treated Sandra Day O'Connor in 1981]