CHARLESTON, S.C. (AP) — Cleveland Thomas hit a 3-pointer with 39.5 seconds left in the second overtime to give No. 19 New Mexico the lead for good in a wild 97-94 victory over UAB at the Charleston Classic on Thursday.

The Lobos (3-0) forced overtime on Kendall Williams' desperation 3 as time ran out to tie it 75-all. Then Alex Kirk hit a 3-pointer with 2.2 seconds left in the first overtime as New Mexico dug its way out of an 86-81 hole for another period.

The Blazers (3-1) weren't through after Thomas' long-range bucket put them down 95-92. Chad Frazier hit two foul shots to cut the lead a point. After Williams' turnover, Frazier drove the lane for what appeared to be a go-ahead basket.

But Frazier's shot missed and Obij Aget grabbed the ball with 18 seconds left and the Lobos held on. They'll play Massachusetts here on Friday.

More From 600 ESPN El Paso