After see-sawing through surges and droughts for 39 minutes and 59 seconds, the Boise State Broncos thought they had beaten No. 17 San Diego State.

Thomas Bropleh put up a wide-open 3-point attempt from the corner but it rimmed out at the buzzer, allowing the Aztecs to hang on for a 58-56 victory Wednesday night.

"I don't know how it gets closer than that," Boise State coach Leon Rice said. "The thing looks like it was halfway down and then somebody at Buffalo Wild Wings pushed the button," he said, referring to a TV ad.

"Tre (Nichols) made a terrific play and got Thomas a great look," Rice added. "It was halfway down. It really was."

Jamaal Franklin had 16 points and Chase Tapley added 14 for San Diego State, which rallied from a 12-point deficit early in the second half. The Aztecs (19-3, 5-1 Mountain West Conference) used a 14-0 run in the second half to take control as Boise State (10-11, 0-6) lost the shooting touch that had given it the big lead.

Anthony Drmic and Nichols scored 17 apiece for Boise State.

"The thing I am most impressed with about our team is that even though we got smacked around, we kept coming back," Rice said. "These are tough, emotional losses and it just kills these guys, and the problem is that there is such a small margin of error when you play a team like this."

Boise State seemed ready to run away with the game after making the first two baskets of the second half to take a 37-25 lead, its biggest of the night. But the Broncos scored just 19 points the rest of the way and lost their seventh straight game.

San Diego State rebounded after a dismal 17-point loss at Colorado State on Saturday.

This one didn't start well for the Aztecs, though.

Boise State stunned the cold-shooting Aztecs by rallying from an early 10-3 deficit. The Broncos went on a 14-0 run, fueled by three 3-pointers and a jumper by Nichols to take a 17-10 lead with 8:14 left before halftime. Garrett Green made one of two free throws with 7:48 left for the Aztecs' first points in nearly 7 minutes.

The Aztecs pulled to 19-16 with a 3-pointer by Franklin and a slam dunk by DeShawn Stephens, only to see Drmic get hot from behind the arc with three 3-pointers plus another long shot that helped the Broncos take a 33-25 halftime lead.

After making the first two shots of the second half, the Broncos bogged down with fouls, turnovers and poor shooting, allowing the Aztecs to go on their 14-0 run.

LaBradford Franklin made an off-balance layup and a free throw to pull the Aztecs to 37-35, Franklin made a fallaway jumper to tie it at 37 and Xavier Thames hit a jumper to give SDSU a 39-37 lead with 10:23 to go, its first since midway through the first half.

SDSU led 47-40 before Boise State closed the gap on a 3-pointer by Nichols and a three-point play by Derrick Marks. SDSU made seven of eight free throws over the last 34.1 seconds.

Marks had 12 points for the Broncos.