The head of India's anti-corruption watchdog has been forced to resign by the Supreme Court on the grounds that he himself faces corruption charges.
PJ Thomas was appointed by the government last year.
But the court overturned the appointment because of charges against him dating from 1992, when he was a civil servant. Mr Thomas denies them.
His resignation is the latest in a series of corruption scandals to hit India's ruling Congress party.
It is also an embarrassment for Prime Minister Manmohan Singh who oversaw the appointment.
Mr Thomas had long resisted demands by opposition parties to quit.
He says that charges against him in a case involving palm oil imports when he was a senior civil servant in the southern state of Kerala in 1992 are baseless.
Mr Thomas and other officials are accused of accepting a contract for importing palm oil at inflated prices, thereby causing significant losses to the public purse. They were all accused of conspiracy to defraud the state government.
The government defended its decision, saying it was not aware of allegations against him and that a government panel had cleared his appointment.
The opposition says the man whose job it is to clean up Indian politics should be above suspicion. It has argued that all the facts surrounding Mr Thomas should have been known when he was named in his post.
The Supreme Court was unequivocal in rejecting the appointment of Mr Thomas.
"We hereby declare the recommendation by the high powered committee... does not exist in the eyes of law," the court, headed by Chief Justice SH Kapadia, said.
"Consequently, the appointment of PJ Thomas as Chief Vigilance Commissioner is quashed."
The main opposition Bharatiya Janata Party (BJP) said the court's decision was "the biggest blow to Prime Minister Singh and his government".
"The dignity of the office of the chief vigilance commissioner has been restored," BJP leader Sushma Swaraj said.
The BBC's Mark Dummett in Delhi says Mr Thomas has never been arrested or appeared in court in relation to the accusations against him. The charges have also never been tested by a judge in court.
Our correspondent adds that the Supreme Court's decision is bound to reinforce the impression that the prime minister is a weak and ineffectual leader - charges he felt obliged to deny on television last month.
Mr Singh headed the committee that appointed Mr Thomas to lead the anti-corruption watchdog last year.
In that role, Mr Thomas was supposed to investigate allegations that millions of dollars were stolen by officials running the Commonwealth games, which took place in Delhi in October.
He was also looking into claims that the former telecoms minister was responsible for India's largest ever scandal, costing the state an estimated $40bn (£24.5bn).
Parliament's winter session was held up by opposition demands for a cross-party probe into the alleged telecoms scam, which the prime minister eventually set up.