Lobo baseball was down to its final out in the bottom of the ninth on Saturday.

New Mexico trailed San Jose State by one run, but was threatening within runners on the corners. A base hit would have tied the game, but that's not what happened in the game's final at-bat.

Tyler Kelly put the ball in play — a slow dribbler toward third base — and while it wasn't an easy put out, it looked as though Spartan third baseman Troy Viola would scoop it up and make the throw to first to end the game.

But for the second time in as many games, Viola made a late-game error that cost his team a run — and in this case, the game with a two-run throwing error that scored Jared Mang and Tanner Baker, who scored all the way from first base — sliding into home and slapping his hands on the plate without even having to beat a throw or a tag.

The blame probably shouldn't fall squarely on the shoulders of Viola. The Spartans raced out to a 4-0 lead on Saturday at Santa Ana Star Field, but the University of New Mexico baseball team kept battling back.

San Jose State struck early in the game, getting a runner in scoring position in the first inning and seeing Johnny Mendoza single home a run for a 1-0 lead.

The Spartans applied more pressure in the top of the second, tallying three runs in the frame to seize control of the game with a 4-0 edge. SJSU hammered out a double and scored later on a base hit, again on a wild pitch and added another despite hitting into a double play before UNM pitcher Nathaniel Garley was able to get of the situation.

New Mexico was able to tack on its first run in the bottom of the second — an unearned one that saw Kelly draw a lead-off walk and advance all the way to third on a throwing error later in the inning. He eventually scored on a Reese O'Farrell groundout to pull UNM to within 4-1.

UNM was held hitless through the first two innings, while giving up six and continued to see San Jose State get on base with scoring opportunities. One of the biggest moments of the game may have been the top of the fourth when Garley was able to escape a bases-loaded jam to preserve the score.

And in the bottom of the fifth, the Lobos put together a two-out rally that erased the deficit and evened things up. Centerfielder Jared Mang drew a walk and was awarded second after the pitcher was called for a balk. Baker blasted a single to score Mang and Kelly doubled home another run before Jared's brother, Connor, tied the game at 4-4 with another base hit.

The Lobos took a brief lead after an interested turn of events in the bottom of the fifth. Brayden Merritt walked and was thrown out trying to steal, while Justin Watari also got a free pass to first after ball four. But the Spartans failed in an attempt to pick off Watari and he raced down the line to grab second base and get into scoring position.

That mistake proved costly as Hayden Schilling singled him Watari on the next pitch, notching another unearned run and giving UNM a 5-4 advantage.

San Jose State grinded out a run in the away half of both the seventh and eighth innings to reclaim the lead, but were denied chances at getting a bigger cushion. Viola grounded into an inning-ending double-play to close out the top of the seventh — though it appeared he may have beaten the throw.

And, despite taking a 6-5 lead in the eighth, the Spartans stranded two more baserunners — leaving runners on the corners when Lobo reliever Malachi Emond got Blake Berry to strike out swinging.

The Lobos couldn't get anything going in the eighth, but was still able to triumph 7-6 thanks to the ninth-inning heroics and a little bit of luck.

New Mexico extended its winning streak to six games and improved to 8-3 overall, getting a victory in walk-off fashion thanks to San Jose State's two-run throwing error in the bottom of the ninth.

The Lobos will look to complete a three-game sweep over the Spartans when the teams return to Santa Ana Star Field at noon on Sunday, March 3.

Robert Maler is the sports editor for the Daily Lobo. He primarily covers basketball and baseball and contributes content for various other sports as well. He can be contacted at sports@dailylobo.com or on Twitter @Robert_Maler.