David McNally, of Nancy Road, Fratton, admitted criminal damage to the flat at Portsmouth Foyer, in Greetham Street.
The 23-year-old damaged a wall and caused damage in the flat with glass and shower gel, requiring it to be professionally cleaned. He committed the offence on June 22.
McNally must pay a £30 fine, £50 compensation and a £20 victim surcharge.
He also admitted resisting a police constable.
Portsmouth magistrates imposed a 12-month conditional discharge.