John Rennie will be having nightmares about Alabama A&M for many years to come.

A&M has been a nemesis for retiring Duke coach John Rennie dating back to his first years as the Blue Devil coach in the 1980s when A&M was a national power.

The Bulldogs no longer have an impact program, but they beat Duke for the fourth time in five meetings with a 4-3 win on Sunday in Rennie’s final regular-season home game as Duke coach.

South African Mosito Ranko was sensational for A&M, putting the Bulldogs ahead, 3-2, with a goal on a free kick and making it 4-3 in the 80th minute with his third goal of the game on a shot from 20 yards out.

Rennie said Ranko’s first goal, which came a minute after Mike Grella put the Blue Devils ahead from the penalty spot, was the turning point.

An errant throw by senior goalkeeper Justin Papadakis left Ranko free with an empty net shot.

“We had earned a 1-0 lead and just gave them a goal,” said Rennie. “That was a devastating point of the game — it was the turning point of the game, no question. It gave them all of the confidence in the world.”

Rennie gave credit to A&M, which has won four of five meetings with Duke, whose only victory came last year.

“It’s no more or less disappointing than any other loss,” said Rennie. “You have to give them an awful lot of credit for scoring some great goals. They were a very talented and a very determined team. The two goals on the free kick and the counterattack were all great goals.”