(CNN) -- A New Hampshire hospital worker was sentenced to 39 years in prison Monday for causing a multistate outbreak of hepatitis C last year, according to a news release from the U.S. attorney's office in New Hampshire.
David Kwiatkowski pleaded guilty to seven counts of tampering with a consumer product and seven counts of obtaining controlled substances by fraud in New Hampshire's U.S. District Court, according to a plea agreement filed in August.
Thirty people were diagnosed with the virus that attacks the liver and can be fatal.
Ten months after he was diagnosed with hepatitis C, Kwiatkowski began working at New Hampshire's Exeter Hospital in April 2011.
Investigators said Kwiatkowski stole syringes of the painkiller fentanyl from patients who were scheduled for surgery.
"Kwiatkowski used the stolen syringes to inject himself, causing them to become tainted with his infected blood, before filling them with saline and then replacing them for use in the medical procedure," the U.S. attorney's office in Concord, New Hampshire, said in a statement.
"Consequently, instead of receiving the prescribed dose of fentanyl, patients instead received saline tainted by Kwiatkowski's infected blood."
According to the plea agreement, Kwiatkowski told an investigator, "I'm going to kill a lot of people out of this."
Before moving to New Hampshire, Kwiatkowski worked as a traveling medical technician for hospitals in Arizona, Georgia, Kansas, Maryland, Michigan, New York and Pennsylvania, officials in those states said.
Kwiatkowski was fired from an Arizona hospital in 2010 after a fellow employee found him passed out in the men's room with a syringe floating in the toilet, according to documents obtained by CNN. A spokeswoman for the Arizona Heart Hospital said Kwiatkowski was immediately fired, and he relinquished his license as a radiologic technologist.
CNN's Holly Yan contributed to this report.