But in the end Mr. Ponte was undone not by the ingrained challenges of Rikers, but by problems that appeared to be of his own making.

On April 28, the city’s Department of Investigation issued a report that found the commissioner had used his city vehicle to take extended trips to his home on the coast of Maine, and had spent a total of 90 days outside of the city last year while violence at Rikers surged.

Several days after that report was released, the Department of Investigation sent a letter to City Hall accusing Mr. Ponte’s head of internal affairs of overseeing an effort to spy on the investigations agency by listening in on one of its investigators’ phone conversations with confidential inmate informants. Rather than inform the investigations agency or City Hall, as municipal rules require, Mr. Ponte told no one and took no action against the internal affairs heard, Gregory Kuczinski, the agency said in a statement.

Image Mayor Bill de Blasio has called Mr. Ponte’s misuse of the city car an honest mistake. Credit... Sam Hodgson for The New York Times

After the vehicle report was released, Mr. Ponte acknowledged taking his sport utility vehicle out of state but claimed that two top aides and his driver had told him — erroneously, it turns out — that he was allowed to use it for out of state travel. The two aides denied so advising him; the driver has not responded to several interview requests.

The Department of Investigation commissioner, Mark G. Peters, wrote to the mayor last week about the spying accusations, requesting that Mr. Kuczinski, whose formal title was deputy commissioner of the Investigation Division, be removed from the internal affairs post. On Monday, Mr. Ponte did so, placing him on modified duty. But the commissioner also defended him, saying he had had a limited role in overseeing the phone surveillance unit responsible for the eavesdropping.

Through it all, Mr. Ponte never appeared to have lost the confidence of the mayor. Indeed, at roughly half a dozen public appearances over the last several weeks, Mr. de Blasio spoke of him effusively, apparently in a last-ditch attempt to save Mr. Ponte’s job — and perhaps, when it comes to Rikers, his own political legacy.