WASHINGTON -- With crowds of admirers swelling outside, Supreme Court Justice Ruth Bader Ginsburg was remembered Wednesday at the court by grieving family, colleagues and friends as a prophet for justice who persevered against long odds to become an American icon.

The court's eight justices, masked along with everyone else because of the coronavirus pandemic, gathered for the first time in more than six months for the ceremony to mark Ginsburg's death from cancer last week at age 87 after 27 years on the court.

Washington already is consumed with talk of Ginsburg's replacement, but Chief Justice John Roberts focused on his longtime colleague.

The best words to describe Ginsburg are "tough, brave, a fighter, a winner," Roberts said, but also "thoughtful, careful, compassionate, honest."

The woman who late in life became known in admiration as the Notorious RBG "wanted to be an opera virtuoso, but became a rock star instead," Roberts said. Ginsburg's two children, Jane and James, and other family members sat on one side of the casket, across from the justices.

With her portrait on display nearby, Ginsburg's flag-draped casket sat in the court's Great Hall for the private service before it was moved outside so the public could honour her. Health precautions because of the pandemic led the court to limit the number of people inside the building, which has been closed to the public since March.

Through the day, thousands of people paid their respects to the women's rights champion and leader of the court's liberal bloc. As darkness fell, the line stretched nearly half a mile from the court as people filed past. The casket was to be on public view until 10 p.m. Wednesday and from 9 a.m. to 10 p.m. Thursday.

Inside earlier, the members of the court were arrayed in their seats in order of seniority, now changed by Ginsburg's death so that Justices Clarence Thomas and Stephen Breyer flanked Roberts. Breyer took the spot Ginsburg held when the court last gathered for a justice's memorial, in 2019 following the death of John Paul Stevens.

Rabbi Lauren Holtzblatt of Washington, D.C., compared Ginsburg to a prophet who imagined a world of greater equality and then worked to make it happen.

"This was Justice Ginsburg's life's work. To insist that the Constitution deliver on its promise, that we the people would include all the people. She carried out that work in every chapter of her life," said Holtzblatt, whose husband, Ari, once worked as a law clerk to Ginsburg.

Outside, some people waiting to pass by the casket said they had driven through the night. One of those in line, Heather Setzler, a physician assistant from Raleigh, North Carolina, said she named her two cats Hillary Ruth and Kiki, in honour of Ginsburg's childhood nickname.

"There was just something about her. She was so diminutive yet turned out to be such a giant," Setzler said, wearing a face mask adorned with small portraits of Ginsburg.

Rachel Linderman and Rychelle Weseman of Olean, New York, travelled to the nation's capital because they said they wanted to be counted among Ginsburg's followers and demonstrate how important her legacy is to Americans.

They said they were buoyed as they waited in line to be surrounded by people who felt the same way.

"I liked that I was with like-minded people," Linderman said. "I feel energized."

"Where we live, we're usually in the minority," Weseman said.

Prominent visitors Wednesday included Vice-President Mike Pence and his wife, Karen, along with former President Bill Clinton, who appointed Ginsburg to the court in 1993, and former Secretary of State Hillary Clinton, whom Ginsburg had hoped would name her successor. President Donald Trump, who traded insults with Ginsburg four years ago, planned to pay his respects Thursday.

Since Ginsburg's death Friday evening, people have been leaving flowers, notes, placards and all manner of Ginsburg paraphernalia outside the court in tribute. Court workers cleared away the items and cleaned the court plaza and sidewalk in advance of Wednesday's ceremony.

Inside, the entrance to the courtroom, along with Ginsburg's chair and place on the bench next to Roberts, have been draped in black, a longstanding court custom. These visual signs of mourning, which in years past have reinforced the sense of loss, will largely go unseen this year. The court begins its new term Oct. 5, but the justices will not be in the courtroom and instead will hear arguments by phone.

On Friday, Ginsburg will lie in state at the Capitol, the first woman to do so and only the second Supreme Court justice after William Howard Taft. Taft had also been president. Rosa Parks, a private citizen not a government official, is the only woman who has lain in honour at the Capitol.

Ginsburg will be buried beside her husband, Martin, in a private ceremony at Arlington National Cemetery next week. Martin Ginsburg died in 2010. She is survived by her son and daughter, four grandchildren, two step-grandchildren and a great-grandchild.

Ginsburg's death has added another layer of tumult to an already chaotic election year. Trump and Senate Republicans are plowing ahead with plans to have a new justice on the bench, perhaps before the Nov. 3 election.

Only Chief Justice Roger Taney, who died in October 1864, died closer to a presidential election. President Abraham Lincoln waited until December to nominate his replacement, Salmon Chase, who was confirmed the same day.

When Justice Antonin Scalia, Ginsburg's closest friend on the court, died unexpectedly in 2016, Republicans refused to act on President Barack Obama's high-court nomination of Judge Merrick Garland.

------

Associated Press writer Jessica Gresko contributed to this report.