Police officers across New York City will soon carry medications to reverse the effects of an overdose from heroin or opioid prescription pills, officials are set to announce Tuesday, expanding from a successful program on Staten Island to all precincts citywide.

The $1.2 million effort, paid for with funds from the New York State attorney general’s office, would give 19,500 kits with the anti-overdose medication naloxone to patrol officers and to other city officers most likely to come into street-level contact with overdose victims.

Those encounters are increasingly frequent in the city as well as around the country amid skyrocketing heroin use and opioid pill abuse. In Suffolk County, officers have saved more than 184 lives since a pilot program began there in 2012. On Friday, officers on Staten Island twice revived residents in the throes of an overdose by administering the drug.

Bringing the drug to officers around the city “will literally save lives,” the state attorney general, Eric T. Schneiderman, said in a statement ahead of a news conference Tuesday morning with the city’s police commissioner, William J. Bratton.