CHARLOTTE, North Carolina — This is what Justin Thomas envisioned all along.

For the first time, he is a major-championship winner, adding another young golfer to the cast of emerging stars in the sport.

Thomas shot 3-under-par 68 on Sunday, taking the lead late in the final round and closing at 8-under 276 to win the PGA Championship by two strokes.

“The prep that I put into this week, I felt like I was ready,” Thomas said. “It just was about going out and doing it.”

On a day with a revolving leaderboard at Quail Hollow Club, Thomas emerged from a cluster of contenders.

The 24-year-old Kentuckian won for the fifth time on the PGA Tour and for the third time in 2017, though this was by far his biggest accomplishment.

Thomas learned from his disappointing conclusion at the U.S. Open, this time he converted.

“I was in contention in the final group for a good finish,” he said of the June major at Erin Hills in Wisconsin. “It wasn’t very realistic for me to have a great chance to win that tournament. Just the experience of going through it (helped).”

Thomas is close friends with another young star, Jordan Spieth, who was around to congratulate his buddy.

Thomas, who began the fourth round two shots off the lead, birdied the par-3 17th hole to open a three-shot lead, though he bogeyed the final hole and had to wait for third-round leader Kevin Kisner to finish.

Italy’s Francesco Molinari (67), South Africa’s Louis Oosthuizen (70) and American Patrick Reed (67) finished at 278. Reed dropped back a stroke with a bogey on the last hole before Oosthuizen posted a birdie there.

“I made enough birdies, but I had too many bogeys,” Reed said. “But then if I went and made another birdie, I’d look at the board and hear another roar, and Justin is making a birdie.”

Rickie Fowler (67) and Japan’s Hideki Matsuyama (72), who was aiming to win for the second week in a row, were next at 279.

Kisner dropped to a tie for seventh at 280 after shooting 74.

“I just didn’t finish it off,” Kisner said.

Thomas didn’t start the round looking like the eventual winner after making bogeys on two of the first three holes. He needed a clutch putt on the first hole just to prevent a double bogey.

“Just stayed patient and knew scores were not going to be crazy low,” Thomas said. “And that chip-in on 13 was huge.”

With about two hours before completion, five golfers shared the top spot. That listed was composed of Kisner, Matsuyama, Thomas, Molinari and Chris Stroud.

At times, it was difficult to determine who had the best chance to lead at the end.

“I gave it everything I had coming in,” Oosthuizen said. “I left myself with an impossible first putt on 16 and could have done better than that but three-putted.”

The round unfolded with a bevy of contenders, but Thomas led at 8 under through 13 holes with Reed just a stroke back.

“The moral of the story of today: very frustrating, a lot of good things going on, but falling just a little short,” Reed said.

Matsuyama had birdies on Nos. 14 and 15 to get back to 7 under before fading again.

Earlier, Matsuyama birdied the sixth and seventh holes to pull even with Kisner.

Kisner took a penalty drop after hitting into the water on the par-5 seventh hole, settling for a bogey. With that, he wasn’t the leader or co-leader for the first time since during the first round on Thursday.

Spieth had his best round of the tournament with a 70 on Sunday, finishing at 286 in a tie for 28th place. That was a long way from securing a career Grand Slam in his first attempt after he won last month’s Open Championship at Royal Birkdale.

Spieth was in danger from falling out of the tournament’s top 50 but rallied with birdies on three of the last seven holes.