A diver bitten twice on the leg by a hammerhead shark has been spared further pain by police, who pulled his car over as he sped on his way to a West Australian hospital for treatment.

The 26 year-old man from Karratha in the state's north, was free diving near Legendre Island, around 40km north of Dampier, when he was bitten twice on the calf by the shark on Saturday morning.

After making his way back to land on his boat, the injured man was being driven to nearby Nickol Bay hospital in Karratha by friends when the car was pulled over on the Dampier Highway by local officers.

Preparing to issue a ticket, the officers were persuaded to let the car carry on its speedy journey when they learned of the his plight.

A WA police spokesman said the man's injuries were not believed to be life threatening, but he is due to be flown by Royal Flying Doctor Service to Perth for further treatment.

AAP