But pressure had been mounting on Ms. Olatoye, whom many considered to be a capable leader of the underfunded city authority, since it emerged last year that she had signed off on federal paperwork indicating that mandated lead paint inspections had been done when they had not. The agency receives the bulk of its funding from the federal government and has a backlog of needed repairs that could cost more than $20 billion to address.

The agency learned of the failure to conduct inspections, lapses that began during the Bloomberg administration, but Ms. Olatoye and top officials did not alert the public — or tenants — until much later, after they had done remediation in apartments. The false filings became public in a report from the city’s Investigation Department — long after Ms. Olatoye first knew of the problem.

Last month, the federal Department of Housing and Urban Development told the agency that it would no longer be able to draw federal funds without approval, a move that stemmed from the issue over the filings.

“While her intentions were never in question, we are long overdue for a fresh start at Nycha,” said the city’s public advocate, Letitia James, who had called for Ms. Olatoye’s resignation after revelations of false filings over lead paint inspections.

Her departure recalled other instances in which Mr. de Blasio had defended an embattled senior official before ultimately pushing the person out or seeing them abruptly leave his administration. His jails commissioner quit last year after it was revealed he had misused his city car for trips to his home in Maine. His commissioner for homeless services, Gilbert Taylor, left in 2015 as the city scrambled to cope with rising numbers of homeless people flooding into shelters.

And now Ms. Olatoye.

In his statement, the mayor said that Stanley Brezenoff would act as an interim chairman of the housing authority during the search for a permanent leader. Mr. Brezenoff recently served a similar interim role at NYC Health & Hospitals, the city’s financially ailing public hospital system.

Ms. Olatoye’s last day is April 30.

“I’m incredibly proud of the leadership team we’ve assembled and the strides we’ve made over the last 4 years to speed up repair times, reduce crime, launch a major development program and bring Nycha into the 21st century,” Ms. Olatoye said in a statement.