Being stuck at home didn't stop a British man from running an outdoor marathon.

James Campbell, a former professional javelin thrower, spent his 32nd birthday on Wednesday doing 6-meter (20-foot) shuttles from one end of his small backyard to the other after promising to run a marathon if one of his Twitter messages received 10,000 retweets.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

By the time Campbell completed the marathon in just over five hours, he had raised more than 18,000 pounds ($22,000) for Britain’s National Health Service to help battle the coronavirus pandemic.

The effort — labeled the #6metregardenmarathon — was live-streamed, with former England soccer great Geoff Hurst among the viewers. Neighbors poked their heads over the backyard fence to give Campbell encouragement.

Campbell ran across a patch of grass, some stones and a small patio in 6-meter (20-foot) stretches. He calculated he would have to traverse his yard at least 7,000 times to reach 42.2 kilometers (26.2 miles).