A horse had to be rescued after bolting during a photoshoot on a California beach and swimming two and a half miles out to sea in its tack.

Santa Barbara Harbor Patrol and the coastguard were called out at 6.30pm on 15 May after seven-year-old Arab William took the unscheduled dip.

A search helicopter spotted him a couple of miles offshore swimming towards oilrigs, according to local newspapers.

A lifeboat crew placed floats under William’s head and attached him to the boat using a towline under his saddle.

“It took more than two hours to escort the animal back to dryland and into the hands of a vet,” said Santa Barbara Harbour Patrol officer Ryan Kelly.

William was reportedly fine after his ordeal and was returned to his owner after being checked by the vet.