"Law & Order" has nabbed its last bad guy.
NBC axed the iconic cops-and-courtrooms show late yesterday after 20 seasons -- leaving it one season short of surpassing "Gunsmoke" as the longest-running drama in TV history, according to various media Web sites.
The New York-based show, once a ratings powerhouse, has struggled for viewers, and in the last few years had been saved from the chopping block only by 11th-hour reprieves.
"From a ratings standpoint, it deserved to be canceled," said industry analyst Marc Berman of Mediaweek.
"L&O," which premiered in 1990, set the template for a new type of drama that incorporated both ends of the legal system -- tracking perpetrators, then bringing them to justice.
"It was a trendsetter," said Berman. "The beauty of 'Law & Order' was that it felt familiar but was different. The show is an absolute legend."
It also spawned two spinoffs, "Law & Order: SVU," still on NBC, and "Law & Order: Criminal Intent," now on the USA cable network.
Over the years, NBC's show has featured a virtual who's who of famous cast members and guest stars, including Jerry Orbach, Chris Noth, Sam Waterston, Dennis Farina, Benjamin Bratt, Paul Sorvino and Elisabeth Rohm
It' been a vital piece of New York City's economy, employing hundreds of local actors and production personnel and becoming the "face" of the Big Apple, for better or worse.
NBC is reportedly creating yet another "L&O," which would be set in Los Angeles. The network will announce its new fall schedule next week.
While NBC officials had no comment yesterday, sources told The Post there was a glimmer of hope that "L&O" could perhaps move to cable or be an occasional movie of the week.
"Discussions are ongoing," one high-placed insider said. "They're still talking, and as long as they're talking, it's not dead."
Show creator Dick Wolf had no comment.