Justice Ruth Bader Ginsburg said Saturday that her work on the Supreme Court has “kept me going” through four bouts of cancer — including one disclosed quite recently — and that she is “on my way to being very well.”

The Supreme Court said Aug. 23 that Ginsburg had completed a three-week course of stereotactic ablative radiation therapy — a highly focused treatment that concentrates an intense dose of radiation on a tumor — after a malignancy was discovered on her pancreas.

It was the second treatment for cancer in nine months for Ginsburg, who at 86 is the court’s oldest member and leader of its liberal wing. Ginsburg had a portion of her left lung removed in December, and in past decades was treated for colon and pancreatic cancer. She broke ribs in a fall in November.

But before a roaring crowd of what organizers said was more than 4,000 at the National Book Festival in the District, she declared: “This audience can see that I am alive.”

Among the worshipful audience members were about a dozen female students from American and George Washington universities who had camped outside the Walter E. Washington Convention Center starting at 3 a.m. to secure their seats when the festival doors opened. They shared granola bars and took turns napping on rolled-up jackets on the ground.

“We are shaking!” said Carly Shaffer, a GWU freshman, wearing a Ginsburg “dissent collar” necklace and weeping after seeing the feminist icon.

Moments before Ginsburg took the stage, the students received a shout-out from Librarian of Congress Carla Hayden. Hayden recalled telling Ginsburg, “You’ve been called recently the ‘Beyoncé of jurisprudence.’ ”

“I said, ‘Could I say that?’ and she said, ‘I’d rather you say the J-Lo,’ ” Hayden said as the crowd erupted with laughter.

Ginsburg was interviewed by NPR legal affairs reporter Nina Totenberg, who started off by asking her, “How about J-Lo? How did that happen?”

About a month ago, Ginsburg said, the singer-actress Jennifer Lopez asked to meet the Supreme Court justice alongside her fiance, former professional baseball player Alex Rodriguez.

“She came to chambers and we had a very nice visit,” Ginsburg said. “She mostly wanted to ask if I had any secret about a happy marriage.”

Ginsburg recounted words of advice from her mother-in-law, given to her on the day Ginsburg married Martin D. Ginsburg, who died in 2010: “It helps, sometimes, to be a little deaf,” Ginsburg said, and the audience howled.

“And that good advice I have followed in every workplace, including the good job I now have,” Ginsburg said. “So if an unkind word or thoughtless word is said, you just tune out.”

Wearing a pink jacket and printed scarf, Ginsburg shared the main stage of the convention center with two women who have been working for years on her biography, Wendy Williams and Mary Hartnett.

Totenberg asked Ginsburg about her health, and why she was not resting for the coming term in October rather than making public appearances.

“I will be prepared when the time comes,” she said. “I love my job — it’s the best and hardest job I’ve ever had,” Ginsburg said. “It’s kept me going through four cancer bouts. Instead of concentrating on my aches and pains,” she concentrates on the work, she said.

A statement from the court’s public information office said the radiation treatment at Memorial Sloan Kettering Cancer Center in New York began Aug. 5, and no additional treatment is planned.

“The tumor was treated definitively and there is no evidence of disease elsewhere in the body,” the court’s spokeswoman said. “Justice Ginsburg will continue to have periodic blood tests and scans. No further treatment is needed at this time.”

Pancreatic cancer is aggressive and hard to treat, experts say. Those consulted about Ginsburg have said it is difficult to form a prognosis based on the scant details released by the high court. But some doctors have expressed surprise that radiation alone has been the treatment. Surgery often is required, or a combination of chemotherapy and radiation.

“It’s a little bit uncommon to just do radiation only,” said Diane Simeone, director of the Pancreatic Cancer Center at NYU Langone Health’s Perlmutter Cancer Center. “It’s often used for disease control. It’s not often a curative approach.”

Ginsburg is one of the oldest justices to serve on the Supreme Court, and her health is a constant matter of concern and speculation. Her inability to serve would provide President Trump with a chance to nominate a third conservative to the high court and shift it further to the right. Ginsburg said in a speech in July that she would continue to serve as long as she felt up to the job.

In the time since, Ginsburg has maintained an active schedule: She was working in her chambers in Washington on the afternoon she completed radiation treatment in New York, and made good on scheduled events in Buffalo near the end of August.

On Tuesday, Ginsburg is scheduled to give a lecture in Little Rock in front of 18,000 people. The free tickets are all claimed, with a waiting list of 16,000, Totenberg said.

By the time the convention center’s doors opened on Saturday at 8:30 a.m., the line was far down the street and around the corner onto Seventh Street NW, stretching several city blocks.

Outside the main entrance, college students leaned against each other at the front of the line, clutching coffee, calling their mothers, posting Instagram stories and playing Uno.

At the front was Karson Taylor, a freshman at American University who decorated her dorm room with a portrait of Ginsburg she bought on Etsy. Taylor and her new college friends had stayed up all night watching “On the Basis of Sex,” a feature film based on Ginsburg’s life, and chugging caffeinated kombucha before ordering an Uber ride to the convention center at about 2:30 a.m.

Right behind them, Anjali Singh and her friends, also AU freshmen, returned to their dorms Friday night after one of their first college parties, changed clothes and went straight to the convention center, lining up by 3 a.m.

“There was this crazy sense of just, like, sisterhood!” said Lillian Frame, another AU freshman among the early arrivals.

Shaffer, 19, found out about Ginsburg’s talk Friday afternoon through Instagram. “We started screaming in the dorm,” she said. Shaffer is on the GWU cheer team, and was scheduled to go to a “cheer bonding” event on Saturday. “I was like, ‘Canceled,’ ” Shaffer said.

She rallied her roommates, persuading them to wake up at 3 a.m. She thought about buying a tent but couldn’t find one at the grocery store near campus. She couldn’t sleep, thinking about Ginsburg, the hero she would finally be able to see.

“She’s the reason I want to go into government,” said Shaffer. “I was her for Halloween three years in a row. Literally, my family hates me because all I do is talk about her.”

Fans of all ages — children to seniors — lined up at the convention center. A group of Girl Scouts, ages 7 to 10, from Alexandria sat in a circle around a Ginsburg doll, wearing their vests and sashes. Next to them, Nicole Niewald, 33, revealed a tattoo of Ginsburg’s signature on her left forearm.

Niewald and her mother flew to the District from St. Louis to see Ginsburg.

“I just think we’re running out of time,” said Niewald, a founding principal of a public charter school about a 15-minute drive from Ferguson, Mo. “She reminds me to be resilient . . . and to not let the negative emotions overcome you, even when it can be really challenging.”

Around the corner, Nancy Johnson, 72, and Kathy Voigt, 73, sat on roller bags filled with books. The avid readers and bookmark collectors have been friends since they met in nursing school about 50 years ago.

“She is such an inspiration. We as women have her to thank for the freedoms that we have,” Voigt said, talking to a mother and daughter ahead of them in the line. “We can’t afford for her to die.”