Retired Supreme Court Justice Sandra Day O’Connor, who became the first female justice in 1981 and then one of the court’s most influential members, announced Tuesday that she suffers from dementia and is “no longer able to participate in public life.”

In a letter released by her family, O’Connor, 88, said she wanted to “be open about these changes, and while I am still able, share some personal thoughts.”

She added: “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.”

O’Connor was nominated to the court by President Ronald Reagan, who was fulfilling a campaign pledge to name the first female justice. She served for a quarter-century, leaving to take care of her husband, John, who was diagnosed with Alzheimer’s disease.

Since leaving the court, she heard cases in courts of appeals around the country, and promoted the teaching of civics to students.

The nonprofit she founded, iCivics, has created 19 games and hundreds of digital lesson plans, on topics ranging from how to run a presidential campaign to how local governments work. According to the foundation, its games were played more than 5 million times last year by K-12 students in school.

O’Connor has been in poor health in recent years. As are other retired justices, she is entitled to hire a clerk, but she last hired one for the term that began in October 2015.

The timing of the announcement seems to have come partly because of changes at the court. Her son Jay O’Connor told the Associated Press that over the past year the family has cleared out her chambers and went through hundreds of boxes of files and other items she had in the building’s basement.

Among the items donated to the court, the Library of Congress and the Smithsonian: A gavel used at her 1981 confirmation hearing, her Presidential Medal of Freedom and T-shirts made annually for an exercise class she started at the high court.

Newly retired Justice Anthony Kennedy is moving into her chambers, opening up a series of office changes to create space for Justice Brett Kavanaugh.

O’Connor, who was born in El Paso, Texas, lives near her home in Phoenix.

One of her last interviews was in 2016, after the death of Justice Antonin Scalia. She said she did not agree with the strategy of Republican senators to keep the post open until after the presidential election.

In her letter Tuesday, O’Connor said she hoped others would take the lead in promoting civics and that she would be watching from the sidelines.

“I feel so strongly about the topic because I’ve seen firsthand how vital it is for all citizens to understand our Constitution and unique system of government, and participate actively in their communities,” she wrote.

O’Connor’s departure from the court marked a moment much like the present one. She was seen as a moderate conservative, with a pragmatic approach that often made her the pivotal member. She was replaced by Justice Samuel Alito, who was more conservative and moved the court to the right.

The court likely faces a similar move with conservative Kavanaugh replacing the more moderate Kennedy.

There are now four retired Supreme Court justices. Besides O’Connor and Kennedy, 82, Justice David Souter, 79, continues to hear cases on the U.S. Court of Appeals for the 1st Circuit in Boston, and Justice John Paul Stevens, 98, gives speeches and writes books.