A boa constrictor is seen in this BDN file photo. A snake of the same species was found in the woods on Cape Cod, where a local man tried to pick it up and was subsequently bitten, fire officials said.

Fire officials say a Massachusetts man has been bitten by a boa constrictor he tried to pick up in the woods of Cape Cod.

Hyannis firefighter Andrew Kleamenakis tells the Cape Cod Times the 20-year-old man was on his way home in Barnstable on Monday when spotted a 6- to 8-foot long snake feeding on a dead animal, possibly a rat.

The snake bit him when he tried to pick it up.

[Python escapes again in coastal Maine city]

Boas kill their prey by squeezing it to death and they are not venomous, but the man went to hospital as a precaution to prevent infection. His name wasn’t released.

Police took custody of the snake, which fire officials think was somebody’s pet.

Follow the Bangor Daily News on Facebook.