Image copyright Reuters Image caption President Barack Obama presented the Medal of Freedom to Sandra Day O'Connor in 2009

Former Supreme Court Justice Sandra Day O'Connor has announced she is withdrawing from public life after being diagnosed with dementia.

In a letter released on Tuesday, the 88-year-old said doctors had diagnosed her with early-stage dementia and "probably Alzheimer's disease".

Justice O'Connor was the first woman to be appointed to the US top court, and a key swing vote. She retired in 2006.

She served as a visiting judge and civics educator after retiring.

What did her letter say?

In a public letter, addressed to "friends and fellow Americans", Justice O'Connor said doctors first 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."

The former justice went on to detail her passion for civic engagement, which led her to create her iCivics education programme eight years ago to help teach young students about their government.

"As my three sons are tired of hearing me say, 'It's not enough to understand, you've got to do something.' There is no more important work than deepening young people's engagement in our nation," she said.

She said her current physical condition meant she could no longer help lead this cause. The justice had not spoken publicly in the last few years.

In her letter, Justice O'Connor said she would continue to live among family and friends in Phoenix, Arizona.

"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 US Supreme Court," she wrote in closing. "God bless you all."

Justice O'Connor's son Jay told the Associated Press that she had begun having issues with short-term memory and that she primarily used a wheelchair, owing to hip problems.

Image copyright Getty Images Image caption Sandra Day O'Connor became a Supreme Court Justice in 1981

What's the reaction?

Chief Justice John Roberts said in a statement on Tuesday that he was "saddened" to learn that his fellow justice "faces the challenge of dementia".

He called her a "towering figure in the history of the United States", breaking down barriers for women.

"No illness can take away the inspiration she provides for those who will follow the many paths she has blazed," he said.

On social media, people thanked Justice O'Connor for her inspiring work and for her bravery in sharing her diagnosis.

California Senator Kamala Harris said on Twitter that Justice O'Connor had "paved the way" for young women.

Senator Susan Collins of Maine said her friend's diagnosis saddened her, but she knew Justice O'Connor would face it "with the strength and bravery that have defined her life".

The Alzheimer's Association thanked Justice O'Connor for making Alzheimer's disease a "national priority".

Image copyright Reuters Image caption Justice O'Connor served as the swing vote to uphold abortion ruling Roe v Wade in a case that challenged it

Who is Sandra Day O'Connor?

Born in El Paso, Texas, in 1930, Justice O'Connor joined the Supreme Court bench in 1981, nominated by Republican President Ronald Reagan.

At age 16 she was admitted to Stanford University, where she graduated in 1950 with a degree in economics.

In 1952, Justice O'Connor graduated from Stanford Law School, third in her class and two places behind her Supreme Court bench-mate, Justice William Rehnquist.

She was known for promoting women's interests in several cases, including as the swing vote that reaffirmed the landmark abortion ruling Roe v Wade in a second case that sought to overturn it.

In a commencement speech at her alma mater, she said: "Ronald Reagan knew that his decision wasn't about Sandra Day O'Connor; it was about women everywhere," according to the Sandra Day O'Connor Institute.

"It was about a nation that was on its way to bridging a chasm between genders that had divided us for too long."

When she retired from the bench in 2006, it was in part to help care for her husband, who had been diagnosed with Alzheimer's.