NEWARK, N.J. — A man who needed emergency surgery after a plastic baggie of drugs he had swallowed ruptured has been sentenced to more than two years in prison.

Federal prosecutors say Omar Vasques received a 30-month term Wednesday. The 24-year-old Bakersfield, California man will also have to serve three years of supervised release.

Vasques had pleaded guilty to possessing and distributing heroin.

Prosecutors say Vasques landed at Newark Liberty International Airport in New Jersey on a commercial flight in September 2016 after having swallowed several plastic bags containing roughly 600 grams of heroin overall.

They say he intended to distribute the drug after his arrival but was instead apprehended by authorities who took him to a hospital. Vasques had surgery after hospital staff discovered one of the baggies had ruptured.