FARMINGDALE, N.Y. — Rickie Fowler lost the lead, the tournament and a guaranteed spot on the Ryder Cup team.

Right when it looked as though Zach Johnson had played his way off the U.S. team, Fowler squandered a chance to earn the eighth and final automatic spot when he shot 39 on the back nine at The Barclays, capped off by two bogeys and a double bogey over his last four holes.

“Very disappointing,” Fowler said. “Just made a couple bad swings at the wrong time.”

Sunday was the final day for Americans to earn automatic spots on the team that will try to win the Ryder Cup back from Europe on Sept. 30 to Oct. 2 at Hazeltine at Minnesota.

Five of the spots were already clinched going into The Barclays — U.S. Open champion Dustin Johnson, Jordan Spieth, Phil Mickelson, PGA champion Jimmy Walker and Ryder Cup rookie Brooks Koepka.

Patrick Reed moved from No. 8 to No. 4 with his one-shot victory at Bethpage Black. Brandt Snedeker and Zach Johnson kept their spots.

Johnson tied for 48th, leaving himself vulnerable for being knocked out of the top eight when Fowler had a two-shot lead early in the final round. Fowler only needed to finish alone in third to overtake Johnson, and he was two shots ahead of third place with four holes to go.

That’s when it all went wrong.

“I’m just trying to win the tournament,” Fowler said when asked if he knew where he stood. “If I win, then it takes care of both things. Obviously, once Patrick got a little bit of a cushion, I still wanted to get the best finish I can.

“It will hurt,” Fowler said. “But it’s only going to make it better for next week. I’ll be in a good spot.”

Davis Love III still has four captain’s picks over the next three weeks. He will make three of them after the BMW Championship on Sept. 12, and the final pick after the Tour Championship, which ends the Sunday before Ryder Cup week.

Bubba Watson closed with a 66 and tied for 13th to move into ninth place, ahead of J.B. Holmes, Fowler and Matt Kuchar, who won the bronze medal at the Olympics.

That gives the Americans two of this year’s major champions and only one rookie.

Spieth, Reed, Walker and Snedeker will be playing on their second Ryder Cup team. Zach Johnson made his fourth Ryder Cup team, while Dustin Johnson is playing for the third time and Mickelson qualified on his own for the 11th time, an American record.

Europe’s automatic nine spots were decided a week ago, and already there are five Ryder Cup rookies in Masters champion Danny Willett, Andy Sullivan, Matthew Fitzpatrick, Rafa Cabrera Bello and Chris Wood.

European captain Darren Clarke makes his three picks Tuesday. Martin Kaymer and Lee Westwood are likely to be two of the picks, and Thomas Pieters of Belgium made a strong case to be a pick when he won in Denmark on Sunday.