ALBANY, N.Y. (CBSNewYork) – Gov. Andrew Cuomo and Mayor Bill de Blasio reached a dramatic agreement to get the homeless off the subways and protect essential workers who depend on mass transit.

The move is unprecedented.

New York City subways have operated 24/7 for the last 115 years, other than blackouts, strikes and severe weather.

The pictures and videos of the homeless turning the subways into underground shelters finally got to Cuomo and de Blasio, who in a rare effort to travel in lockstep announced a plan to get the homeless off the subways and make mass transit safe for essential workers who depend on it.

CORONAVIRUS PANDEMIC

Subways will be closed every night from 1 a.m. to 5 a.m. starting Wednesday. Subways, buses and trains will be cleaned every 24 hours to help stop the spread of COVID-19.

“I would wager in the history of public transportation in this nation you’ve never had a challenge of disinfecting every train every 24 hours,” Cuomo said. “Wherever a hand could touch, or coughing, sneezing. Wherever droplets could land. So you have to disinfect the entire interior of that car. And then you have to disinfect the stations, the handrails, everything that people could be touching. It is a massive undertaking that we’ve never done before.”

WATCH: Gov. Andrew Cuomo Announces Subway Shutdown

There will also be an Essential Commuter Program to provide transportation for the estimated 10,000 commuters who use the subways during the overnight hours. It will include for-hire vehicles, paid for by the MTA. Grocery store workers, restaurant workers, hospital cleaners and more are all considered essential workers and will be part of the program. They will be limited to two rides per night and will have to show credentials showing their employment.

Ridership is down overall 92% on the system, and those hours are the slowest in terms of ridership, the governor said.

“This is going to be one of the most aggressive, creative, challenging undertakings that the MTA has done. It’s going to require the MTA, the state, the city, the NYPD to all work together,” Cuomo said. “It’s not that easy to stop train service. You have to close down stations. You have to make sure people don’t walk in. Then you have to figure out how to clean all these trains and all these stations.”

Web Extra: See Gov. Cuomo’s Presentation (.pdf)

The MTA will also disinfect all Long Island Rail Road and Metro-North Trains every day, though those lines will not be shut down because ridership is down.

“Just think about it. The entire public transit system in downstate New York will be disinfected every 24 hours,” Cuomo said.

Cuomo cited the compounding nature of the pandemic for making the decision necessary.

“MTA employees who run that system, care for that system, get sick, call in sick as they should. They don’t want to infect other people. The number of MTA employees comes down. Number of NYPD, New York Police Department, they get sick, their numbers come down. You now have fewer MTA workers, you have fewer NYPD workers on the trains and in the stations. We have now a greater need than ever to disinfect the subways, the buses, the stations,” Cuomo said. “At the same time, we need our essential workers to go to work.”

Cuomo said the nightly cleanings is the best method to protect essential workers.

“Which makes sense if you want the essential workers to come to work. It makes sense if you don’t want the infection rate to go up in your society. It makes sense if you don’t want the essential workers to get sick. And again, it is our obligation as human beings to reciprocate and make sure we’re doing everything we can,” Cuomo said.

The announcement came just days after de Blasio proposed a plan to get the homeless off trains by closing 10 end-of-line stations overnight.

CORONAVIRUS: NY Health Dept. | NY Call 1-(888)-364-3065 | NYC Health Dept. | NYC Call 311, Text COVID to 692692 | NJ COVID-19 Info Hub | NJ Call 1-(800)-222-1222 or 211, Text NJCOVID to 898211 | CT Health Dept. | CT Call 211 | Centers for Disease Control and Prevention

The mayor said he would have teams of outreach workers, including NYPD officers, at the the transit hubs to urge the homeless to leave the streets for shelter.

In an unusual show of unity, Mayor de Blasio joined the governor’s press conference. Cuomo praised de Blasio as “really stepping up to the plate” and “doing something that no mayor has ever attempted to do before.”

De Blasio said it was important to disrupt the homeless from riding the trains in an endless loop.

“This new plan will disrupt that unacceptable reality, and allow us to get help to people more effectively. Because if you’re not going back and forth all night on a train, and you’re actually coming above ground where outreach workers are there to help you, where NYPD officers trained in homeless outreach are there to support homeless people, get them to a better situation,” de Blasio said. “It’s not going to be easy. No-one said it’s going to be easy.”

The president of TWU Local 100 Tony Utano says his members will be safer when the homeless individuals are taken off the trains.

“It’s actually a good move for my members who are now gonna be in the subway disinfecting the trains,” Utano told CBS2’s Dick Brennan. “They belong in a place where they can get some help … and now with this virus going on, they have the potential to carry the virus, which would transmit into anybody going into the subway system.”

Watch Dick Brennan’s report —

But not everybody’s on board, some homeless advocates think plans to increase the policing of homeless on the subways are counterproductive and cruel.

“Many people who are on the subways are there because they do not feel safe in congregate shelter settings where COVID is spreading very rapidly,” said Jacquelyn Simone, policy analyst for the Coalition for the Homeless.

Advocates for riders also spoke out about the plan.

“Even during a crisis, New York is and will be a 24/7 city. Governor Cuomo’s suspension of subway service must be strictly temporary while a longer-term solution is developed and implemented. And, in the meantime, the governor must ensure that riders have access to safe, reliable, and frequent replacement bus service,” said Riders Alliance Executive Director Betsy Plum.

“The governor has to make sure there’s safe, reliable, frequent bus replacement service,” said Danny Pearlstein with the Riders Alliance.

PHOTO GALLERY: Coronavirus Shutdown 30 Days In

And what about getting the word out?

“People are going to get caught off-guard,” Brooklyn Councilman Carlos Menchaca said.

He says the city needs to do strong outreach.

“We need to get the message out to immigrants who are the essential workers using the subways in their language, through their newspapers, through the nonprofits that they trust,” Menchaca said.