Clint Trickett passed for 511 yards and four touchdowns, and West Virginia gave away a 22-point lead before Josh Lambert kicked a 47-yard field goal as time expired to give the Mountaineers a 40-37 victory over Maryland on Saturday.

West Virginia (2-1) let a 28-6 lead dwindle to 28-27 in the third quarter, then gave away a 10-point advantage in the fourth quarter before Trickett directed a 65-yard drive to set up Lambert's game-winning kick.

Trickett went 37-for-49, and his passing yardage was the second-most in West Virginia history behind a 656-yard performance by Geno Smith in 2012. The Mountaineers finished with a whopping 694 yards in offense compared to 447 for Maryland (2-1).

West Virginia's Kevin White had 13 catches for 216 yards and Mario Alford caught 11 passes for 131 yards and two scores.

A year ago, Maryland beat West Virginia 37-0 while Trickett watched from the sideline.