San Jose State was seconds away from an epic road victory on Friday night against Washington State.

Emmet Brown found wide receiver Treyshun Hurry while rolling to his left on fourth-and-10 for a 20-yard touchdown that gave the Spartans the lead with 26 seconds to go.

A pass to Nick Nash on the two-point play stretched the advantage to three.

But Washington State drove for a tying field goal, took the lead in the second overtime and then made a strip fumble on a two-point attempt to end a wild night in the Palouse.San Jose State fell 54-52 to lose for the first time in four games under new coach Ken Niumatalolo.

Washington State improved to 4-0.

“It’s so tough to lose like that because we gave everything we had and we were in it to the last second,” Nash said. “I’m really excited for our future, although this one stings.”

WSU quarterback John Mateer, who passed for 390 yards and four touchdowns, led his team down field to set up a 52-yard field goal kick for Dean Janikowski as time expired in regulation.

Janikowski’s kick sailed through the middle of the uprights.

“He might be one of the best running quarterbacks I’ve seen,” Niumatalolo said about Mateer. “Even when we thought things looked good for us, he’d escape out of there. The guy was Houdini.”

Both quarterbacks threw interceptions in the first overtime period.

Dylan Paine’s 7-yard run and Mateer’s run on the two-point conversion play gave Washington State a 54-46 lead in the second overtime.

San Jose State responded with a 4-yard touchdown pass from Brown, a Washington State transfer, to Nash.

But the Spartans were stopped on the two-point try.

“Washington State made one more play than us, which hurts at the end,” said Brown, who passed for 375 yards and four touchdowns.

San Jose State led 38-24 going into the fourth quarter before Washington State erupted for 19 unanswered points.