NEW YORK - After a long wait, Mayor Bill de Blasio on Friday announced his support for a pilot program that would bring safe injection sites to the city.

The plan calls for four facilities to open after a six to 12 month period of outreach to the communities where they will be located.

The neighborhoods include Gowanus, Midtown, Washington Heights and Longwood.

Addicts would be allowed to inject and consume drugs under supervision of medical professionals.

Social workers would also be on hand to counsel drug users.

They would be financed and run by nonprofit groups authorized by the city.

In a press release, Mayor Bill de Blasio said, in part, "After a rigorous review of similar efforts across the world, and after careful consideration of public health and safety expert views, we believe overdose prevention centers will save lives and get more New Yorkers into the treatment they need to beat this deadly addiction."

But there are still major obstacles since the sites seem to violate federal law.

The city also needs the support of several district attorneys and the State Health Department before it can open any sites.

Appearing on NY1's "Inside City Hall" Thursday, Council Speaker Corey Johnson praised the plan.

"I know this is controversial. I know this sounds strange to people that we're trying to give permission to people to use illegal drugs. This is us saying we recognize this is a problem. The war on drugs has failed. Let's connect these people to treatment and hopefully save some lives," Johnson said.

This comes a day after activists staged a rally near City Hall demanding the city open such facilities.