An energetic dog south of the border has raised more than $20,000 for cancer research, after he escaped from his yard and ran most of a half-marathon charity race.

Dozer, a three-year-old golden retriever-poodle mix, was with his owners visiting family near Baltimore, Md., on May 13 when he joined the 2,000 runners passing by the yard.

He set off about eight kilometres into the 21-kilometre Maryland Half Marathon, and runners reported seeing him at several points afterward along the route.

A power outage had disabled an invisible fence around the property, a local TV station reported, which set the stage for Dozer's escape.

Video uploaded to YouTube -- which has been viewed nearly 180,000 times -- shows the intrepid pooch crossing the finish line at the 2 hours and 14 minute mark, as onlookers cheer and chuckle.