Florida trailed 83-81 with just under 30 seconds to play.
Alabama had the ball with a chance to close if it took care of the inbounds pass. The Crimson Tide didn't, and Gators guard Noah Locke took advantage.
Locke cut in front of, Bama guard Jaden Shackleford near midcourt and barreled towards the basket.
Much to the delight of the O'Connell Center crowd, his layup went in and tied the game. The Gators rode that comeback momentum into overtime, eventually winning the double-overtime affair.
Florida triumphed 104-98 to open SEC play in Gainesville on Saturday night.
Alabama (7-6, 0-1) came into the game winners of three in a row, averaging 95.6 points per game in that span.
In the first half, the Tide showcased that offensive prowess early and often, and the Gators (9-4, 1-0) really had no answers.
Guard James Bolden (nine points in 10 minutes) and forward Blake Reese (10 points) led the scoring for Alabama early on.
The Tide extended its lead to as many as 21 points behind seven first-half treys.
The Gators started the game with a nice flow to the offense and led early on. But a scoring drought that spanned over three minutes killed the momentum UF had, and Alabama took control from there.
Locke and forward Kerry Blackshear Jr. led their team in the scoring column with nine and seven points respectfully, but the Gators only shot 36.4 percent from the field in the first half.
The half ended positively for the home team, though.
Guard Andrew Nembhard's three-point shot found the bottom of the net as the half came to a close. That shot (UF's first and only three of the half) capped off a 7-0 run that cut the deficit to 46-32 at the break.
"I told our guys that we were fortunate, that the game could be really ugly right now," UF coach Mike White said. "We were down 14, we finished (the half) strong, now let's go clean some things up."
UF responded, and that 7-0 sprint ballooned into a 13-0 run to start the second half after a pair of back-to-back threes from Locke and Blackshear Jr.
The Gators reduced the lead to six with chances to shrink it further, but missed opportunities led to Alabama buckets to keep the Tide comfortably ahead.
Alabama led by 13 with 11 minutes to go, and the Gators again made another push.
A 9-2 UF run minimized Bama's lead to 67-61, but with every huge basket Florida would make, the Crimson Tide always had an answer.
It looked like White and his team were heading for a 0-1 start in SEC play, but late-game drama changed that narrative quickly.
Florida was down eight with two minutes to go, but Alabama's missed free throws and three-point plays from forward Keyontae Johnson, Nembhard (career-high 25 points, four assists) and Blackshear Jr. (24 points and 16 rebounds) cut Bama's lead to two with under a minute to go.
That spurt set up Locke's game-tying steal and score to bring the game into overtime.
"I recognized the first initial action that they had," Locke said. "When I saw the ball was like a lob and not a hard pass, I knew I could just run through it, so I just ran through it and laid the ball in."
Florida and Alabama traded leads through the first overtime period, but the Gators had the ball on the last possession with a chance to win.
Nembhard's fade was short, and Blackshear Jr.'s putback didn't make it from his fingertips before the clock expired.
Double overtime looked like it could turn into triple overtime as the game was tied at 98 with 42 seconds to play, but two clutch free throws from guard Scottie Lewis gave the Gators a lead that they wouldn't squander.
After only scoring 32 in the first 20 minutes of play, UF's issues on offense disappeared in the second half and beyond as the team scored 72 points to close out the game.
Now the Gators have scored over 100 points in back-to-back games.
"We can't celebrate very long, but I do think we can gain confidence in the fact that we were just about dead in the water a couple different times, and we just found a way," White said. "Hopefully we can build upon that."
Follow Evan on Twitter @evanmplepak and contact him at [email protected]