Gavin Kensmil picked up a loose ball in the final seconds of overtime and passed it to Bain at the Lumberjacks' foul line. Bain dribbled the length of the court to finish a layup past the outstretched hand of Duke's Jack White.
"I saw my teammate grab it, and I looked up at the clock. We had about 2.6 seconds," Bain said after the game. "I was like, 'I have to get on my horse.' I went as fast as I can to try to lay it up. It's like a layup drill. I could feel the dude on my back, and I just prayed it [would] go in."
The Blue Devils were favored by 27.5 points at the Westgate Las Vegas SuperBook, surpassing Gardner-Webb's 26-point underdog win over Kentucky in 2007 as the largest upset in a Division I men's basketball game over the past 15 seasons.
Stephen F. Austin overcame a 15-point deficit to take the lead in the second half and forced overtime on a Kensmil layup with 19 seconds remaining. Duke's Cassius Stanley missed a contested midrange jumper at the buzzer.
Overtime included just three made baskets. After Stephen F. Austin's Cameron Johnson failed to finish at the rim, Duke had an opportunity for the final shot with the game tied at 83. Tre Jones missed a midrange jumper, but Wendell Moore grabbed the offensive rebound and kicked it back out to Jones. Jones penetrated and tried to pass it to Matthew Hurt, but Hurt couldn't grab it cleanly and the Lumberjacks jumped on the loose ball. Kensmil came out of the pile with the ball and passed it to Bain.
Stephen F. Austin had a timeout remaining, but Bain drove 75 feet for the winner instead.
Bain's buzzer-beater came less than three months after Hurricane Dorian destroyed his family's home and severely damaged his father's church in his native Bahamas. As of noon ET Wednesday, more than 1,300 people have donated to a GoFundMe for Bain's family organized in September by Stephen F. Austin, and the fundraiser has topped $47,000 in donations.
It's a massive spike from the roughly $2,000 that had been raised before Tuesday night's game.
"My family lost a whole lot this year, and I'm just playing this game for them," Bain said in a television interview after the game. "Just playing for my SFA family, my family back home in the Bahamas. I just want to make my country proud, and my whole team is behind me. ... When everything happened earlier in the year, they had my back, and I just wanted to return the favor."
The loss snapped the Blue Devils' 150-game nonconference home winning streak, the longest active streak in Division I. It was their first nonconference loss at home since they fell to St. John's on Feb. 26, 2000.
"It's a very difficult loss. It's also a loss that if we would have won, we would not have been deserving of winning," Duke coach Mike Krzyzewski said. "That's the way I look at it, so it's on me, but you have to give credit to them. They were really good, he's a good coach and a good program, and they outplayed us."
Stephen F. Austin entered Tuesday's game at Cameron Indoor Stadium at 4-1, coming off a 12-point loss at Rutgers. The Lumberjacks went 14-16 last season.
"We've been battling the flu," Stephen F. Austin coach Kyle Keller said. "We've actually practiced pretty terrible this week. I told my wife today, I said, I hope we continue to fight. Just next man up, like they talk about in the NFL."
The Lumberjacks were led by Kevon Harris' 26 points, Kensmil's 15 and Bain's 11. Stephen F. Austin made just two 3-pointers all game, scoring 64 points in the paint -- the most Duke has allowed in a game in the past 10 seasons, according to ESPN Stats & Information.
Freshman center Vernon Carey Jr. led Duke with 20 points and 11 rebounds, but he went 4-for-11 from the free throw line. As a team, the Blue Devils missed 16 free throws, their most in a home game since 2008.
"They were better. Bottom line," Krzyzewski said. "They were tougher than we were. They played with great poise. And we helped them. You can't give up 64 points in the paint. We don't even give up 64 points. And we gave up so many layups.
"You go 11-of-24 from the foul line in the second half, it's just a recipe to lose. So we weren't deserving of winning. That team was deserving of winning, and they won."
With No. 1 Duke and No. 3 Michigan State both losing this week, college basketball is likely to see a new No. 1 team next week. Louisville was No. 2 in this week's Associated Press poll, and the Cardinals play Western Kentucky on Friday.
This is the first time that more than one No. 1 team has lost in November. Duke's loss was the third top-ranked defeat already this season, following Michigan State's loss to Kentucky and the Wildcats' defeat at home to Evansville.
Information from The Associated Press was used in this report.