A man is recovering in hospital after being rescued from the waters of Port Phillip when he jumped in to collect his crashed drone.

The 22-year-old was using a drone to take night photos off St Kilda Pier when the remote control device plunged into the water.

The South Yarra man stripped down to his underwear and jumped off St Kilda pier to try and save the drone.

But he had to be rescued when he started suffering cramps from the cold water.

He was having trouble getting back onto the pier because there was no ladder, so a friend and a passer-by tied clothing together to form a makeshift rope.

The man held onto the rope in the water for about 30 minutes before he was rescued by water police.

Victoria Police said unfortunately he was not able to save the drone "which is now in the depths of the bay".

The man is recovering in hospital.