ALBUQUERQUE, N.M. (AP) -- Brigham Young quarterback John Beck knew what was coming from New Mexico's defense. After all, he sees it every day on the practice field.
Confident and unrattled under pressure by New Mexico's blitzing defense, Beck threw for 371 yards, including the game-winning 23-yard pass to Matt Allen with 1:40 left Saturday night as BYU rallied for a stirring 27-24 win over the Lobos.
"I saw soft coverage and just shot it out there," said Beck. "Matt Allen just made a play. Great players make big plays. He made a guy miss and took it in the end zone."
BYU runs a virtual carbon copy of New Mexico's defense. Former New Mexico defensive coordinator and now first-year BYU head coach Bronco Mendenhall installed the blitz-happy defense when he became the Cougars' defensive coordinator two years ago.
"They [the Lobos] do a lot of things the same and a few things a little different than us," said Beck. "It does help, but you've still got to make plays."
Beck, Allen and halfback Curtis Brown did just that in the Cougars' fourth-quarter comeback to erase a 24-13 New Mexico lead.
With BYU (2-3, 1-2 Mountain West) down 24-19 with 2:48 left, Beck -- the fourth leading passer in the nation -- needed just a minute and eight seconds to take the Cougars 80 yards on five plays. Brown added a two-point conversion run.
Beck was 5-for-5 on the winning drive, including passes of 29 yards to Todd Watkins and 14 yards to Brown. The pass to Brown got the Cougars to the Lobos' 23 and on the next play Beck hit Allen near the sidelines. Allen juked his way past a Lobo defender into
the end zone.
Beck also threw TD passes of 11 yards to Daniel Coats and 5 yards to Joe Semanoff. He was sacked four times but kept his composure.
"The thing about this [New Mexico] defense is that a lot of it is just delusional. It looks like a blitz when it's really not," Beck said. "From the quarterback's standpoint, even though it looks like a blitz, just stay poised. I had a lot of confidence in my linemen that I could just stand back there, believe in them and make plays."
New Mexico (3-3, 1-2) lost its third straight and saw its bid to win back-to-back games against the Cougars for the first time in 34 years disappear in a fourth quarter defensive meltdown.
"There were all kinds of opportunities for us to win," said New Mexico coach Rocky Long. "If we stop either one of their last two drives, we win. But we found a way to lose it."
The Lobos led 24-13 early in the fourth and were driving for another score when Kole McKamey fumbled on a run inside BYU's 10. Linebacker Markell Staffieri recovered for the Cougars at the 7.
"That was the turning point," Mendenhall said. "If they go in and score, it's a different game."
Until then, McKamey had baffled the Cougars with his footwork, and receiver Hank Baskett was a constant deep threat as he pulled in McKamey's passes.
Beck, who completed 34-of-44 passes, threw eight completions in the ensuing 93-yard drive that ended with Brown scoring on a 9-yard run to cut the deficit to 24-19 with 7:15 left.
"When John is prepared correctly, he'll execute right," Mendenhall said. "Our coaching staff did an excellent job of letting him know what he'd see tonight. He held his composure, delivered the ball on time and made the right choices."
New Mexico became conservative with its next possession and the Lobos got a couple first downs with the help of two pass interference calls on BYU defenders. But the Cougars held and took over at their own 20 with 2:48 left.
New Mexico had a final shot at forcing overtime and reached BYU's 47 before turning the ball over on downs with less than a minute remaining.
Long said his defense continues to make too many mistakes but accepted blame for the loss.
"There were some problems out there that a coach should recognize. And if they can't grasp this scheme that you're trying to run, you ought to be smart enough to device a scheme they can run," Long said. "It was a coaching mistake."
McKamey had 321 yards of total offense -- 103 yards rushing and 218 passing -- and scored on a 2-yard run in the second quarter. Baskett caught 11 passes for 141 yards and the Lobos also got rushing TDs in the first half of 16 yards from Travis Brown and 2 yards from DonTrell Moore.
But for the second week in a row, New Mexico self-destructed.
The Lobos had a season-high six turnovers last week in a 49-28 loss at TCU. This time there was only McKamey's fumble, but it was the break BYU needed to launch its comeback.
BYU tight end Jonny Harline caught a career-high 10 passes for 123 yards. Brown had 104 yards rushing on 20 carries.
Former Mizzou wide receiver Jeremy Maclin discusses his time with the Tigers, and his return to Missouri to play with the Kansas City Chiefs.
The son of USC offensive coordinator Tee Martin picked Clemson over both USC and Tennessee.
The Seminoles sent the Gators a Valentine's Day message. It was not accompanied by chocolate.
During Valentine's Day, relive the worst heartbreaking moments sports teams put their fans through in 2015, including Michigan's debacle over Michigan State and a costly error from the Mets in the World Series.
A lawsuit claiming that the University of Tennessee has violated Title IX policies and created a "hostile sexual environment" includes an alleged incident involving former Vols QB Peyton Manning.
LSU added to its future running back group by picking up a commitment from the playmaking Edwards-Helaire.