Johnson, 43, had a per-mile pace of 7:12 while running in bib number 4848. He ran the first 5K with a 6:53 mile pace. Fans cheered on Johnson along the course. The seven-time Cup Series champion also posed for pictures.
"That was the most challenging thing I've ever done, what an experience," Johnson tweeted, while posting a video of himself crossing the finish line.
Johnson trained for months with a goal of breaking the three-hour mark at the marathon. It was his first marathon. He suffered numerous injuries during training, including one to his sacroiliac joint in his pelvis, one to his left calf and another to the IT band on the outside of his thigh.
"It doesn't matter if I'm on foot, on a bike or in my race car, there is always that excitement for the race," Johnson said before starting his run.
Johnson also posted a video of a warmup jog before the race, where he took familiar left turns.
"Making a few left turns to start the day. Seemed appropriate," he tweeted.
Johnson finished No. 12 in the Toyota Owners 400 on Saturday at the Richmond Raceway in Richmond, Va., before traveling to Boston for the 26.2-mile marathon.