They were the first line of defense in the city’s response to the coronavirus pandemic and now Mayor Bill de Blasio says the city’s public health hospitals will be charged with contact tracing — another key part of the recovery. 

But sources tell NY1, the change comes after an internal power struggle between the mayor and his Health Department, which has historically been tasked with tracing efforts.

Starting in June, a contact tracing army —expected to be 2,500 strong — will be deployed throughout the city.

“We are now going to take the next big step with this test and trace vision that is going to allow us to squeeze this disease, constrain it further,” de Blasio said Friday during his daily briefing at City Hall.

But first, he is making changes to the chain of command.

The city’s test and trace strategy — expected to play a major part in any reopening effort — will now be led by the city’s Health and Hospitals Corporation, which runs the public hospital system.

“This effort will be housed and will be led by the organization that's been throughout this fight nothing less than heroic, and that is our Health and Hospitals," he said.

It’s a departure from how contact tracing has traditionally been done. The Department of Health, considered among the best in the world, has historically been tasked with tracing disease and containing outbreaks.

Criticism for the mayor’s decision has been swift. Officials are questioning the wisdom of changing protocol in the middle of a crisis and City Council Speaker Corey Johnson said Friday he plans to hold hearings on the matter.

But the mayor has defended his decision, saying since they're already doing testing, it makes sense for Health and Hospitals to handle tracing.

Sources tell NY1 the change is the result of a weeks-long power struggle between the mayor and leadership at the Department of Health. On more than one occasion they have questioned his judgment and disagreed with how he has handled the ongoing health crisis.

Dr. Mary Bassett, who served as health commissioner during de Blasio’s first term, said there are three key elements to fighting the virus: testing, tracing, and isolating — all which are done by the Health Department.

“These are core functions of public health agencies around the world, including New York City, which has decades of experience,” Dr. Bassett said in a statement. “To confront Covid-19, it makes sense to build on this expertise.”

But on Friday, de Blasio dismissed criticism of the decision, saying it was done in the best interest of the city. 

“My job is not to ensure people's happiness who work for 8.6 million New Yorkers,” he said.

So far, the city says nearly 7,000 applications for contact tracers have been reviewed and are being evaluated for hiring.