Trevon Duval of Duke had nowhere to go on Saturday against the defense of Tariq Owens, center, and his St. John’s teammates at Madison Square Garden. Lance King/Getty Images North America

That’s two losses in three games for No. 4 Duke — and this one to a team that had not won since December.

Shamorie Ponds scored 33 points and the St. John’s men’s basketball stunned the Blue Devils, 81-77, at Madison Square Garden on Saturday afternoon, snapping an 11-game losing streak and handing a suddenly suspect Duke squad its second defeat in eight days.

“We got what we deserved,” Duke Coach Mike Krzyzewski said. “We weren’t able to knock them out after we lost the first 12 rounds of a 15-round fight.”

Bashir Ahmed added 19 points and Tariq Owens had 17 for the Red Storm (11-13), who overcame an early 10-point deficit and fought off Duke’s heralded freshmen down the stretch in their biggest victory under their third-year coach, Chris Mullin.

It was the first win for St. John’s since Dec. 20, against Saint Joseph’s.

“We would have taken a win if it was in an empty gym,” Mullin said. “Thank God January is over.”

St. John’s was playing the second of three straight games against top-six opponents in a span of nine days. Next up, a visit to No. 1 Villanova on Wednesday night.

“We are happy but we can’t stop here,” Ponds, a sophomore guard, said. “We have to keep pushing. This is big to get a win on the board. We can start fresh.”

Gary Trent Jr. had 22 points for the Blue Devils (19-4), who perhaps got caught looking ahead to their first matchup of the season with their bitter rival North Carolina on Thursday night.

Krzyzewski didn’t think so.

“Ponds was really as good a guard offensively as we’ve played against,” Krzyzewski said. “We came in prepared.”

Shamorie Ponds of St. John’s, who had 33 points, celebrated during the second half of Saturday’s game against Duke. Andres Kudacki/Associated Press

The freshman sensation Marvin Bagley III scored 19 for Duke but sat out a significant chunk of the second half with four fouls. Wendell Carter Jr. added 14 points and 15 rebounds.

Outhustled all afternoon, Duke was coming off an easy win on Monday over Notre Dame that followed a 65-63 loss at home to No. 2 Virginia last weekend.

“I thought they made us look bad, but we made ourselves look bad,” Krzyzewski said. “We did not play basketball the first 32 minutes worthy of our program. And we had blank faces, we didn’t talk, we were like five individuals out there and it was disgusting, really. I do not know why. I can tell you that’s not the group I’ve coached all year, and they were a very frustrating group to coach today because they didn’t respond to anything until the last eight minutes, and that’s unacceptable.”

Winless in 11 Big East games this season, the Red Storm improved to 11-2 in nonconference play. They led by 11 with six and a half minutes left before Duke stormed back and took a 73-72 advantage on Trent’s two free throws with 1 minute 35 seconds to play, its first lead since early in the second half.

That brought fans of both teams to their feet for an exciting finish.

Ponds, who also grabbed seven rebounds in his second consecutive 30-point game, put St. John’s back in front with a driving layup and then drained a 3-pointer from the corner to make it 77-73 with 40 seconds left.

“We stayed composed,” he said.

Grayson Allen’s only 3-pointer, seconds later, trimmed the margin to one, but Owens hit two free throws with 32.2 seconds to go.

Bagley made one of two free throws with 20.4 seconds left and Ponds did the same to make it 80-77 with 17.5 seconds to go. Allen missed a 3 at the other end and Owens grabbed the rebound before sinking one of two free throws with 2.7 seconds remaining to seal it as Ponds waved his arms, spurring on the crowd of 19,812.

“The Garden was rockin’, no question,” said Mullin, who was recruited by Krzyzewski out of high school in 1980-81. “Duke has that brand. They bring ’em in.”

It was the first meeting between the teams since Krzyzewski recorded his 1,000th career win with a 77-68 victory at Madison Square Garden on Jan. 25, 2015.

NOTES

Duke fell to 34-19 at the Garden, including 29-11 under Coach Mike Krzyzewski. … The Blue Devils will be back in New York next month for the Atlantic Coast Conference tournament at Barclays Center in Brooklyn. … The matchup between two of the top programs in Division I history was played in tribute to Howard Garfinkel, who ran Five-Star basketball camp from 1966 to 2008, attracting many of the game’s best players before they blossomed in college. The logo at center court read, “The Garf.”