Justice Ruth Bader Ginsburg said Tuesday that Supreme Court justices should work as long as they can and shouldn't manipulate their retirement so a like-minded president can appoint their successor.

Some liberals have recently called on the 80-year-old Ginsburg to retire so that President Barack Obama can choose her replacement. If she stays beyond his term, it would leave open the possibility that a Republican would name the liberal justice's successor.

But Ginsburg, the oldest justice on the court, cited Justices William Brennan and Thurgood Marshall as two justices appointed by Democratic presidents who left their replacement to Republican successor presidents. Ginsburg said she supposed many people wanted both men to leave when a Democrat was president, but she noted that neither did.

Brennan was appointed by Dwight D Eisenhower and announced his retirement in 1990 at the age of 84 for health reasons. Marshall retired in 1991 at the age of 82. George HW Bush chose David Souter and Clarence Thomas as their respective successors.

Ginsburg made the comments during an event hosted by the Northern Virginia Technology Council. She was responding to a question by moderator and former US Solicitor General Ted Olson, who served as solicitor general from 2001 to 2004 under President George W Bush. Olson asked whether justices should time their retirements so that a president of the same party that appointed them could choose their successors.

"I think one should stay as long as she can do the job," Ginsburg said in response.

Ginsburg said the "number one" question a justice should ask is "Can you do the job?"

"Can you think as well? Can you write with the same fluency? At my age you take it year by year. I'm OK this year," she said, to applause.

Ginsburg has for years been fending off questions about whether she should leave the court, in part brought on by her health. She had colon cancer in 1999, pancreatic cancer in 2009 and also suffered broken ribs more recently. Still, she has not missed any time on the job.

This isn't the first time Ginsburg has suggested the party of the president will not influence her decision on when to retire. She told The New York Times in August that "there will be a president after this one, and I'm hopeful that that president will be a fine president."

But, the chorus of people calling on Ginsburg and her 75-year-old liberal colleague Stephen Breyer, to retire has grown louder in recent days and months, with several articles written by liberals advocating retirement while a Democratic president is in office.