HILLSBOROUGH (AP) — An Orange County man who was bitten by a king cobra earlier this year has pleaded guilty to a misdemeanor charge of violating a state law for how venomous snakes should be housed.

Media outlets report that 21-year-old Ali Iyoob, who was bitten May 2, was sentenced Monday to two years of supervised probation. He must also pay $4,000 to the state for costs related to snake removal.

On May 4, authorities removed 34 snakes — 18 of which were venomous — from Iyoob’s home.

The state doesn’t prohibit owning venomous and constricting snakes, but requires them to be housed in a sturdy, secure enclosure with a visible label. Authorities say Iyoob didn’t house the snakes lawfully.

Iyoob told the judge he was bitten by the king cobra while he was trying to address the snake’s medical issues