[Read our new story about how Mr. O’Brien was fired from the earlier job.]

By January 2016, Mr. O’Brien had begun working as Mr. de Blasio’s deputy chief of staff, having received the job based on the recommendation of a top political strategist.

By February 2018, two women working for the city had accused Mr. O’Brien of harassment, and an investigation was conducted, and Mr. O’Brien left.

In April 2018, he was hired by the same political strategist who had recommended him to the mayor two years before.

This month, Mr. O’Brien was fired from his latest job after The Times reported the reason for his departure from City Hall. The firm that had hired Mr. O’Brien said it “had no idea” about the series of allegations against him.

A spokesman for Mr. de Blasio said the Department of Investigation, as part of a standard background check, contacted the governors association and “received confirmation of title and work dates and no adverse information” about Mr. O’Brien’s employment.

A look ahead: The scandal raises questions about the thoroughness of the city’s vetting procedures and how Mr. de Blasio handled the aftermath of the harassment case.

The mayor has tried to project himself as a progressive, transparent leader and feminist champion, but that image may be tarnished after he allowed Mr. O’Brien to go on to his next job without scrutiny.