More recently, charges that other L&I deputies may have improperly speeded zoning and permit approval for city bigwigs exposed further problems and triggered another outside investigation.
Both matters are being investigated.
Sources said Levin's letter of resignation was delivered to Mayor Rendell Wednesday afternoon. They said Rendell accepted the resignation, which will take effect Dec. 8 - one day after Levin is scheduled to be honored in Washington as the country's "Best City Manager" by the Virginia-based ''Governing News" magazine.
Neither Rendell nor Levin would comment on the end of one of the administration's most productive - and exasperating - partnerships over the last four years.
Reached at home yesterday, Levin said he was "not commenting" on whether he has decided to step down.
"There's been 63 memos between myself and the mayor's office since October 13th (the day the Daily News ran the story about Levin's aide)," Levin said. ''I've talked about my intention to leave. Whether the time is now, I think that's between the mayor and myself.
"I am still commissioner and I plan to be at work on Monday," Levin said.
Rendell, when asked whether Levin was leaving, said, "I have no comment on that at this time."
The sources said that Levin was not asked to step down, despite the controversy that has engulfed his department in recent weeks.
Sources said it was unclear who might replace Levin, but one possible pick is Fran Weston, a deputy managing director and former Republican state representative.
Levin was by far the most visible and controversial L&I commissioner in recent memory.
A train buff who lent Rendell his personal railroad car for a whistle-stop campaign ride in 1991, Levin began making noise soon after taking the job in 1992.
The eccentric, independently wealthy engineer inherited an institutionally corrupt department in which sloth was the standard and constituent service was, largely, for sale.
"When you drain the swamp, you're bound to upset the alligators," he often said.
The new commissioner revamped department fees and offered speedier processing of building permits for a premium. He invited reporters on sweeps of street vendors and business strips to catch proprietors who didn't have proper business licenses.
He later did the same with landlords.
And he wasn't shy about going after big fish from time to time.
After the Rendell administration painstakingly negotiated a deal to ensure construction of the Spectrum II indoor arena, Levin cited the Spectrum's owners for building sample luxury boxes to sell tickets without the proper building permits.
And there was the time in 1994 when he made national news after fining a Wendy's restaurant in Olney $96,000 for selling underweight hamburgers.
Wendy's offered a plausible explanation for the weight controversy, and Rendell later made nice with Wendy's owner, Dave Thomas, at a City Hall news conference.
Levin also dramatically increased the revenue L&I generated for the city - from $16 million to $28 million. But he had his critics even before the current tempest.
Billboard opponents said he was reluctant to enforce laws regulating outdoor advertising, and housing activists complained that he failed to revoke the rental licenses of landlords whose dwellings were found to cause lead poisoning.
His freewheeling style rankled higher-ups in City Hall and other departments, where he was considered a "cowboy commissioner" with a large ego.
In interviews and memos he often echoed themes of underappreciation, intellectual frustration and the sense that others were jealous of his success and relationship with the mayor.
But that relationship suffered some in recent weeks over Levin's handling of a strip-club controversy involving the deputy responsible for his initiative in helping community groups crack down on the neighborhood nuisances.
L&I regulatory enforcement chief Frank Antico publicly lobbied a community group on behalf of his son and family, who had majority ownership in a business venture to reopen a strip bar in South Philadelphia. The group filed the sole objection to M.A.G. Enterprises' application for an adult cabaret variance before the Zoning Board of Adjustment.
Levin backed Antico, saying he saw no conflict of interest because Antico had disclosed the family stake in the bar. Rendell, however, saw it differently, calling it a "clear conflict" and referring the matter to what sources said was an ongoing investigation into Antico's conduct by the inspector general.
That clash - followed by Levin's reluctant reassignment of Antico at the administration's urging - increased tension between Levin and Rendell.
In the past, such clashes led the commissioner to dash off another one of his famously flippant memos.
This time, however, the train buff has apparently decided he's reached the end of his line with City Hall. And the mayor punched his ticket.