Editor's note: Beth Karas worked as a prosecutor in the Manhattan District Attorney's office from 1986 to 1994 before joining CourtTV, now known as In Session.
New York (CNN) -- Off the coast of Algiers one day in 1944, a young Navy officer plea-bargained with God as his torpedoed ship, the USS Lansdale, took on water.
If he survived, he vowed, he would dedicate his life to public service.
"I'd always thought of going into government service," Robert M. Morgenthau recalled recently. "But when my ship was torpedoed off Algiers and I was floating around in the water, I made promises to the Almighty."
He kept those promises. For more than a generation, Morgenthau was the district attorney in Manhattan, making him the face of law and order in the nation's most densely populated county.
Thursday was Morgenthau's final day in office. He is 90 and ran the office for 35 years, serving longer than any other prosecutor in New York.
Morgenthau took office in January 1975, after spending four years in private practice and nine years as U.S. Attorney for the Southern District of New York -- an appointment from his boyhood friend, President John F. Kennedy.
At the time, New York was in the throes of a fiscal crisis -- and a crime wave. As he leaves office, another fiscal crisis looms, but street crime is down. In 2009, there were fewer murders in New York than at any time in recent memory.
Over the years, Morgenthau racked up the high-profile prosecutions, trying celebrities, mobsters, terrorists, money launderers, socialites and Wall Street scoundrels with equal zeal. The 500-plus lawyers in the Manhattan DA's office handle about 100,000 cases each year.
It has been called the nation's premier prosecutor's office and is the model for the television series "Law and Order." The show's first fictional district attorney, Adam Schiff, played for 10 years by the actor Steven Hill, was said to be based on Morgenthau. The real-life Morgenthau also had a cameo role in the show as a judge.
Morgenthau recalled meeting Hill: "I was mad at him because I understood that he was getting $25,000 an episode, and I told him when he quit I wanted his job, and he didn't tell me."
As the real D.A., Morgenthau created 34 bureaus and units, specializing in labor racketeering, identity theft, firearms trafficking, Asian gangs and cold cases, to name a few.
The sex crimes unit, in its infancy when Morgenthau took office, grew with the help of an $80,000 grant into the prototype for similar units across the country. Most recently, the elder abuse unit handled the trial of Anthony Marshall, who was convicted of bilking his aging mother, the late millionaire philanthropist Brooke Astor, of millions and sentenced to up to three years in prison.
The office did receive one prominent black eye -- prosecuting the wrong people for rape in the 1989 Central Park jogger case. When DNA evidence surfaced incriminating someone else in the rape, Morgenthau went to court in 2002, agreeing with the defense's request to dismiss the charges.
Attorney Michael Warren who headed the effort to throw out the rape convictions, said Morgenthau didn't go far enough: "As a prosecutor who assesses innocence and guilt, he should declare not only to the New York community but to the nation and the world their innocence."
Morgenthau said he had gone far enough by consenting to a dismissal.
Morgenthau wears two hearing aids and shuffles when he walks, but he's still sharp. "He's the same at 90 as he was at 60," said Elkan Abramowitz, an attorney and long-time friend who worked under Morgenthau as a federal prosecutor.
His wood-paneled office is a cluttered nest of memorabilia. During a visit in late October, Morgenthau pointed to the photos hanging on the walls -- of his father with Franklin D. Roosevelt, and himself with President Kennedy and Attorney General Robert F. Kennedy.
He described watching history unfold while having lunch with Robert Kennedy on November 22, 1963, at Kennedy's Virginia home. The phone rang and Kennedy answered it. From a distance, Morgenthau saw Kennedy cup his hand over his mouth in shock.
"He came back and said, 'That was J. Edgar Hoover,' and he said Jack had been shot in Dallas," Morgenthau recalled.
Despite his Zelig-like relationship with history, Morgenthau said he has no plans to write his memoirs, that he "doesn't look back, only forward."
In hindsight, though, it's clear that Morgenthau changed the way the office handles felony cases. The old system resembled a conveyor belt, with different prosecutors handling different stages of a case.
"As many as five different prosecutors could handle a case before it was resolved," recalled Linda Fairstein, a best-selling author who headed the sex crimes unit for years. "It was inefficient, cumbersome, and harmful to the substance of the case."
Under the old system, dismissal rates were high and conviction rates were too low, in Morgenthau's opinion.
He reorganized the office, implementing a method known as "vertical prosecution." A single prosecutor stays with a case from start to finish. It is easier on the victims and makes the prosecutors better lawyers, Morgenthau often said. Ultimately, it also reduced the dismissal rates and increased the rate of conviction.
The world's most important financial markets and institutions are in Manhattan and, on a quiet day, about $4 trillion passes through Manhattan, Morgenthau estimates. Therefore, financial crimes that originate here can have global reach.
He made white-collar crime a priority, allowing the office to reach into some deep pockets. Soon, ill-gotten gains were seized and rolling into the state and city coffers.
After prosecuting individuals, unions and mob-controlled trash-collection companies, for example, the DA's office and the NYPD each received a third of $26 million in forfeited illegal profits.
"We pay our own way," Morgenthau boasted at a recent event. Earlier this year, his office received $175 million in a settlement with Lloyd's bank, which had been accused of wire fraud in the way it handled wire transfers from Iran. Last year, the office sent $181 million to the city and $119 million to the state -- in total about four times the DA's city budget.
Despite his popularity and fat Rolodex, Morgenthau has his critics. Some say he was adept at playing the media. Some allege the office is elitist, filled with Ivy League snobs.
"They regularly ignore the rules and are notoriously unwilling to admit errors," said defense attorney Ron Kuby, protégé of the late William Kunstler.
Morgenthau was opposed twice in his re-election bids -- in 1985 by civil rights attorney C. Vernon Mason and in 2005 by former prosecutor and judge Leslie Crocker Snyder.
The 2005 race got ugly as the Democratic primary loomed. The New York Times endorsed Snyder in an editorial with the headline: "When to End an Era," suggesting Morgenthau had stayed in office too long.
Still, Morgenthau beat Snyder, who ran again in 2009, losing to Cy Vance, Jr. who had Morgenthau's endorsement as well as that of the Times.
Most recently, Morgenthau was embroiled in a budget dispute with New York City Mayor Michael Bloomberg.
The DA's office holds millions of dollars -- collected from grants, fines, and forfeitures -- in as many as 60 bank accounts. Last month, Bloomberg accused Morgenthau of maintaining "secret bank accounts," and the mayor insisted that all of the money should go to the city, not the state of New York.
Morgenthau called the accusation "false and irresponsible," maintaining that the city has always known about the bank accounts. He says his office has reached a truce with City Hall and will cooperate fully in a review by the City Comptroller's office.
Morgenthau's office has had a far-reaching influence. At least 80 prosecutors from there have risen to the bench, most notably Sonia Sotomayor, who was sworn in over the summer as an Associate Justice of the U.S. Supreme Court. Other well-known alums include the late John F. Kennedy Jr., Andrew Cuomo and Eliot Spitzer.
The incoming DA, Cyrus Vance Junior, son of President Jimmy Carter's secretary of state, has big shoes to fill, political observers say.
"The hardest thing in the world is to replace a legend," said Rudy Giuliani, another high-profile former federal prosecutor who went on to become mayor of New York City and run for president.
But in this case, Giuliani noted, "Vance has the benefit of taking over a talented office -- one of the best, if not the best, in the country."