Syracuse had the toughest of tasks Monday: The unranked team headed south to take on No. 1 Duke at Cameron Indoor Stadium. But the Orange managed to pull off a shocker that included a first-half buzzer beater from well beyond half court.

The long-range heave, all the way from the foul line extended area of Syracuse’s side of the court, was tossed up by the Orange’s Elijah Hughes. Somehow the ball went in, cutting Duke’s lead to just one and sending Syracuse to the locker room with a major morale boost before it finished off the upset in overtime, 95-91.

That shot gave Hughes 18 points in the first half, and he finished with 20. Teammate Tyus Battle had a season-high 32, and Syracuse’s Paschal Chukwu chipped in 10 points and a career-high 18 rebounds. Duke’s Zion Williamson led all scorers with 35 points and added 10 rebounds, and fellow freshman RJ Barrett had 23 points and 16 rebounds, but they could not prevent the Blue Devils from suffering their second loss of the season and first in ACC play.

With his team down one point with 16 seconds left in regulation, Williamson was fouled and went to the free throw line, but he could only make one of two, and the game went to an extra period. Duke (14-2, 3-1) was held to 2-for-8 shooting in overtime, and the Orange (12-5, 3-1), which was a 17-point underdog, had major reason to celebrate.

Duke began the game without Cam Reddish, the third of its first-year stars and the hero of its win over Florida State on Saturday, when he hit a three-pointer with 0.8 seconds left to beat the 13th-ranked Seminoles. Duke also lost freshman guard Tre Jones to a shoulder injury early in Monday’s loss, but Syracuse, which fell at home to unranked Georgia Tech in its previous game, was not about to get any less excited about a win that could help immensely when the NCAA tournament field is selected.

The win in Durham, N.C., was all the more impressive because Duke jumped to a 12-0 lead featuring dunks from Williamson and Barrett, and the Blue Devils looked ready to run the Orange off the court. However, Duke ended up shooting just 31 for 80, including a woeful 9 for 43 from three-point range against its opponent’s noted 2-3 zone. Syracuse was a far more efficient 11 for 25 from beyond the arc.

“We were going to gamble a little bit on their shooters, from the perimeter,” Syracuse Coach Jim Boeheim said of the Blue Devils after the game. “They’re very capable of making a lot of those shots, but in games you watch them play, they have some games where they don’t make them.”

Calling his team’s performance a “great effort,” Boeheim said, “We were coming off a game [in which] we couldn’t shoot anything, and obviously you get discouraged when you lose a game like that at home, and you come back Monday and have to play here, and you get that kind of start — I’m very proud of how they were able to bounce back in that game.”

“They’re a really good team. I didn’t think we handled it as well as I would have wanted,” Duke Coach Mike Krzyzewski said. “In the second half we fought like crazy, and we missed so many open shots.”

According to ESPN, Duke lost at home to an unranked opponent for the first time as an Associated Press No. 1 team, after posting a 90-0 mark in previous such contests. ESPN also noted that while holding the top spot, Duke had been 104-0 in home games against teams other than North Carolina, and that Boeheim improved to 3-2 in road games against top-ranked foes, joining Gary Williams (3-11) as the only coaches with more than two such victories.

Boeheim offered praise for Williamson, who has set the college basketball world ablaze en route to establishing himself as the likely No. 1 pick in June’s NBA draft, while the coach noted the unusual physique of the Duke star, who is listed at 6-7 and a remarkable 285 pounds.

“It’s hard to defend him; he’s a physical specimen,” Boeheim said. “He’s like Charles Barkley was, except he shoots better than Charles did — and he’s not as fat.”

In one first-half sequence, Syracuse forward Marek Dolezaj, listed at 6-10 and 180, took a charge from Williamson and went sprawling. The sophomore eventually had to be helped off the court.

Duke came away with a more pressing injury issue, though: The team announced after the game that Jones had suffered an AC joint separation and was out indefinitely. An important defensive player for the Blue Devils, Jones came into the contest second in the NCAA in assist-to-turnover ratio, behind only Cincinnati senior guard Justin Jenifer.

“You can assume that everything is always going to be great, but life happens,” Krzyzewski said. “Life happened to our team tonight, and some unusual things.”

“When that shot went in,” Williamson said of Hughes’s improbable buzzer beater, “it just showed what kind of night it was for them. It seemed like everything they threw up was just bottom of the net. They just hit a lot of shots.”

Read more from The Post:

‘We have everything that I like’: Trump serves fast-food feast for Clemson’s White House visit

Kyler Murray declares for NFL draft amid reports he wants more money from Oakland A’s

Homeless man gets three AFC championship tickets after helping a Chiefs player stuck in the snow

Carson Wentz over Nick Foles shouldn’t be an automatic choice for the Eagles