A rare basking shark accidentally caught in the nets of a fishing trawler off Portland has had his body donated to science.

Weighing almost three tonnes, the 6.5 metre-long male basking shark was the surprise find for fishermen on Sunday, who found the deceased animal in their nets.

Senior collections manager of vertebrate zoology at Museum Victoria Dianne Bray praised the captain's initiative in alerting the museum.

The second biggest fish after whale sharks, basking sharks are rarely found in Australian waters because they live well-off the continental shelf.