Ruth Bader Ginsburg racked up numerous wins in the fight for women’s rights long before she joined the US Supreme Court, but her death Friday puts at risk one of American feminists’ key victories: the right to have abortions.

Ginsburg’s death at 87 left women’s rights advocates in deep mourning at the loss of a revered idol.

Women’s groups lauded “RBG” as a giant of the law and a source of inspiration for millions.

But feminists are quickly turning to the battle ahead to protect the gains achieved during Ginsburg’s decades of activism and her tenure on the US high court.

“Tonight we honour that legacy, but tomorrow we’re going to need to get to work to preserve the ideals she spent her life’s work defending,” said Alexis McGill Johnson, president of the Planned Parenthood Action Fund, which lobbies for abortion rights.

“Ruth Bader Ginsburg was an icon, a pioneer, a hero and a legend,” said Shaunna Thomas, executive director of UltraViolet, a national women’s group.

“Her spirit must inspire us in these hard days ahead as we honour her incredible life and protect her legacy.”

Who will replace her?

The worry focuses on who President Donald Trump will choose to succeed her on the court.

Facing an uphill battle for re-election on November 3, Trump has promised – and his voter base largely demands – a justice who could tilt the court toward reversing Roe v Wade, the landmark 1973 ruling that guaranteed women the right to have abortions.

Most of the judges Trump has on a list of possible replacements oppose abortion.

“It’s time for Roe v Wade to go,” said Republican Senator Tom Cotton, one of them.

Even if the court is not ready to go that far, it could easily rule to allow individual states to tighten abortion restrictions, resulting in de facto bans.

In recent years the court has turned back several such cases, often by bare 5-4 majorities.

Ginsburg, with her dedication to the right of women to control their bodies, was a key to these decisions. A conservative successor will likely tilt the court in the opposite direction.

‘Three strikes against me’

A brilliant jurist, Ginsburg had already established a new path for women when she was named to the Supreme Court in 1993.

Having seen her mother denied a college education, she made an early statement of her own, finishing first in her class at Cornell University in 1954.

Five years later, at Columbia Law School, she again topped her class.

But when she tried to get a job, she found herself snubbed by New York’s powerful law firms, even as they readily recruited her male classmates.

“I had three strikes against me. One, I was Jewish. Two, I was a woman.

But the killer was, I was a mother of a four-year-old child,” she said in 2016.

So she turned to teaching while fighting against laws which, at the time, permitted companies to discriminate on the basis of gender, both in salaries and social benefits.

‘She was a fighter’

Between 1972 and 1978, as an attorney for the American Civil Liberties Union, she argued six cases before the Supreme Court, each time using the US Constitution’s guarantee of equal rights to chip away at the edifice of sexual discrimination until it completely collapsed.

She chose her cases in ways that would attract the sympathy of even the most conservative justices, to educate them about the issues of discrimination.

In one case she even represented a widower who, because he was a man, had been denied survivor benefits from his wife to care for their child.

After joining the Supreme Court, she broadened the equal rights fight to include other minorities, especially the LGBT community. She also defended immigrants and favored environmental protection.

But it was her early fight for women that brought her comparisons to the pathbreaking first black justice on the court, Thurgood Marshall.

After news of her death Friday, hundreds of women flocked to the steps in front of the court, lighting candles and laying flowers to honour the tiny but hugely influential woman who many said had inspired their own careers.

Early Saturday the Democratic candidate for vice president, Kamala Harris, herself a former prosecutor and California attorney general, arrived on the scene.

“RBG was one of my pioneers, an icon, a fighter,” she told AFP. “She was a woman in every way.”