Joey Logano thought he had his first victory of the 2014 season wrapped up just before he was set to take the white flag at the Duck Commander 500.

A late caution put those that in doubt but didn't change the outcome as Logano raced past Jeff Gordon on a green-white-checkered finish to claim his first win at the 1 ½-mile quadoval at Texas Motor Speedway.

Logano, who had top-five finishes in each of his TMS starts last season, was the class of the field throughout the race, is now the seventh winner in seven Sprint Cup races this season.

It's doubtful any of other six were as dominant as Logano, who along with Penske Racing teammate Brad Keselowski combined to lead 182 of the 340 laps run.

Logano's No. 22 Shell Pennzoil/Hertz Ford wasn't outside the top five the final 200 laps of the race. But that doesn't mean he wasn't sweating it when his lead of more than two seconds evaporated after Kurt Busch blew a tire seconds before Logano was set to take the white flag.

Then Gordon gambled and took two tires on the final pit stop, putting Logano third on the restart before he made a last-lap crossover pass on Gordon to win by 0.476 seconds.

It wasn't the way Logano expected the race to end but he had no complaints after his fourth-career win.

"You get so mad that you can barely control yourself," Logano said of the late caution. "I had to make sure I stayed calm and tried to give (crew chief) Todd (Gordon) the information I needed to.  He had to make the right call. The guys made the money stop. This is awesome. We've been in contention every race this year to win these things."

Logano came to Texas having led laps at five of first six races, but with a finish no better than fourth. But he announced his presence Monday when he took the lead on Lap 226 and led the race for the next 74 loops.

He ended up leading three times for a race-high 108 laps. The third and final time he took the lead was on the last lap. Gordon, who was driving a Chevy sponsored by the Texas A&M Engineering Department, was sixth with the final caution flew and knew the only way to beat Logano was with a two-tire gamble.

The gamble worked for a lap.

"Coming in sixth, you're in that spot where you can gamble," Gordon said. "You're not going to win it with four (tires). You're not going to win it with none. I think that was a good call and I felt very fortunate to finish second. Joey was the class of the field there the second half of the race. I knew it was going to be hard to hold those guys off."

Logano's main competition at the end doomed his own chances. Teammate Brad Keselowski, who led 85 laps, was popped for a speeding penalty exiting the pits and finished 15th.

While the second half of the race was the Logano show, the first half was a wacky affair. Crowd favorite Dale Earnhardt Jr. was out early after he ran through the grass on the frontstretch, cut a tire and saw his No. 88 Chevrolet go up in flames.

Six-time Sprint Cup champ Jimmie Johnson's hopes ended in that same incident as debris from the Earnhardt mishap damaged the No. 48 Chevrolet and led to seven pit stops for Johnson.

That mess followed a yellow-flag start to the race that brought on the first race mishap. Several cars were forced to pit because the jet dryers on the track because the force of the dryers popped hoods up on the cars. They were allowed to pit without losing track position.

The race started under yellow because the track was being dried after Sunday's rain led to the postponement and the third Monday Sprint Cup race at the track.