Perhaps just as important, the Lobos sent the No. 13 Cougars a message.
"It's a huge statement to beat a team like BYU at home with the record they have here," said Dairese Gary, who had 23 points in the 83-81 victory. The Cougars had won 21 straight at home.
Darington Hobson added 20 points and 14 rebounds for New Mexico (27-3, 13-2), and his block in the closing second preserved the school's first win in Provo since 2000.
"It's a big win for our city, the state and our program," Hobson said.
Michael Loyd Jr. scored all of his career-high 19 points in the second half to lead the Cougars (26-4, 11-3). He played in place of Jimmer Fredette, the league's leading scorer, who scored six points and played only 59 seconds of the final half because of a stomach problem.
Tyler Haws added 18 points for BYU.
The Cougars went to power forward Noah Hartsock to try to tie the game as the clock wound down. He had a mismatch against Gary, who went for the steal and missed, but Hobson came over to block Hartsock's shot in the paint with one second left.
"Dairese switched to a big," Hobson said. "In our defense, we help. I just tried to make a play and keep it as clean as possible."
Gary tipped away an inbounds pass as time ran out.
"It was a great college game, a great atmosphere," BYU coach Dave Rose said. "Two great teams went down to the wire. We had our chances and they didn't go our way."
With the win, the Lobos set records for consecutive conference wins with 13 and consecutive conference road wins with seven. They also set a school record with 10 road wins this season.
"Our guys have proven themselves all year on the road," Lobos coach Steve Alford said. "To win back-to-back championships in a conference like this is saying something, and to win 13 in a row is saying something."
Gary missed four of six free throws in the final five minutes in front of a sellout crowd of 22,644. Will Brown missed two more with 0.9 seconds left, but the Lobos still held on.
"It was a fast-paced game from beginning to end and you felt your arms and legs get heavy," Gary said. "The crowd was wild and it feels like the floor is shaking under you."
Loyd Jr. made eight of nine shots after he replaced Fredette early in the second half.
"Jimmer lost his energy," BYU coach Dave Rose said. "I felt we needed more energy at that position and Mike did a great job."
Loyd made a fastbreak layup and then dunked with 59 seconds left to tie the game at 80, but A.J. Hardeman grabbed the offensive rebound after a miss by Gary and scored with 42 seconds left to give New Mexico the lead.
Gary made one of two free throws with 28 seconds left for an 83-80 lead, and New Mexico survived to reach 6-0 against ranked teams this year.
"We still have to prove ourselves," Hobson said, "but we're doing a good job of it."