A young female tourist was so engrossed in Facebook on her mobile phone that she walked off St Kilda pier and almost drowned, police say.

She fell off the pier about 11.30pm on Monday, said police, but fortunately a witness called police.

Senior Constable Dean Kelly of the water police squad said he and fellow officers made the four-minute trip from Williamstown to St Kilda when alerted to the near-drowning.

Their high-speed boat arrived to find the woman floating about 30 metres from the pier.