Brad Keselowski ran inside the top five for much of the afternoon Sunday at Martinsville Speedway and had a solid finishing position within reach, but a late caution turned out to be costly, relegating the Fastenal Ford to a 24th place finish.

The two-time Martinsville winner entered the top-10 halfway through stage two, and by lap 175 was comfortably in fifth place. A green-flag pit cycle began with around 110 laps remaining with Keselowski in fifth. He remained on track to lead seven laps before pitting with 100 to go, before the caution came out just a lap later, putting him a lap down to the leaders.

He took the wave around for the ensuing restart and restarted 19th with 88 to go, and was unable to regain all of the track position from early in the race.

Keselowski began the day from the 21st position and ended the opening stage of 80 laps in 18th. From there he began his charge forward, starting stage two in 15th, before working to ninth by lap 160. He went on to finish the second stage in fifth earning stage points, and was as high as third on the stage three restart.

The final 46 laps ran caution-free with Keselowski ultimately crossing the line 24th.

The No. 6 team returns to action next week at Talladega Superspeedway. Race coverage Sunday is set for 3 p.m. ET on FOX, MRN and SiriusXM NASCAR Radio.