With just three weeks before his retirement, Manhattan District Attorney Robert M. Morgenthau, who has fiercely defended his turf throughout his 34-year tenure, is locked in a showdown with New York City in which he insists that the continued independence of the prosecutor’s office is at stake.

The city, which funds more than 80 percent of the district attorney’s spending, sees things differently. Mayor Michael R. Bloomberg has accused Mr. Morgenthau, 90, of keeping roughly $80 million of the “public’s money” in more than 60 bank accounts the city said it recently discovered.