BOSTON — A former hospital technician infected with hepatitis pleaded guilty to stealing syringes filled with painkiller, injecting himself with the drug, refilling the dirty needles with saline solution and leaving them for hospital use, causing an outbreak of the disease in a New Hampshire hospital.

The technician, David Kwiatkowski, in papers filed on Monday in federal court in New Hampshire, pleaded guilty to 14 criminal counts related to seven cases where he caused infections in patients ranging in age from about 40 to more than 80.

Kwiatkowski was working at Exeter Hospital in New Hampshire in early 2012 when he began stealing syringes of the powerful pain medication Fentanyl. Hospital workers unwittingly used the refilled dirty needles on patients.

He admitted committing similar needle swaps at hospitals he previously worked at in Georgia, Kansas and Maryland.

He was convicted of seven counts of tampering with a consumer product and seven counts of obtaining controlled substances by fraud.