Prison officers searching for weapons and contraband got a nasty surprise in a Victorian cell.

One of the inmates at Fulham correctional centre in Gippsland had been keeping a venomous baby brown snake inside a Tupperware container.

He warned the officers about the reptile before they searched his cell on 22 December.

Corrections Victoria says the snake most likely made its way into the prison when the inmate picked it up.

“He regarded it as a pet but I don’t think he had it very long as there are regular routine searches,” the spokesman said.

The baby brown was removed from the cell and a snake catcher came and took it away.