Pennsylvania officials warned residents on Monday about a dangerous batch of heroin that has caused 22 deaths.

The state’s attorney general, Kathleen G. Kane, said that the overdose deaths were most likely caused by a mix of heroin and fentanyl, a strong pain medicine.

“Together, these drugs are creating an extremely dangerous and potentially lethal combination for users,” Ms. Kane said in a statement.

The deaths occurred in Pittsburgh and several surrounding counties, officials said. The heroin was placed in small bags stamped with the words Theraflu, Bud Ice and Income Tax.