In the end, it was a lot closer than it should have been, but Southern California won its 10th national championship Sunday, beating Stanford 14-12 in Palo Alto.

Everyone in the pool!@USCWaterPolo takes the men's crown for the 10th time in program history!! #FightOn pic.twitter.com/6DzEgM5uns — USC Trojans (@USC_Athletics) December 3, 2018

The Trojans came out of the gate hot, building a 5-0 lead before fans even settled into their seats. Stanford found some life in the second and third quarters, but after a USC goal to start the final period, the Cardinal trailed 12-4 and the game seemed all but over.

VIEW THE FULL BRACKET | CHAMPIONSHIP HISTORY

That's when the Cardinal found their second wind. Through the final 6:38, Stanford outscored USC 8-2. With 1:37 left, down 13-10, the Cardinal drew a five-meter penalty shot — a fantastic chance to cut USC's lead to two with plenty of time left — an opportunity that would have been unimaginable only minutes ago. But the ball slipped through Ben Hallock's hand and he never got a shot off, giving USC the only break it would need to put the game away. The slip-up was uncharacteristic of Hallock's night, as the sophomore had five goals on the night — four coming in the fourth quarter.

Despite the effort, Stanford ran out of time. After scoring their fifth straight to make it a 13-11 game with 58 seconds left, Stanford was forced to press, and gave up a one-on-none score to USC freshman Jake Ehrhardt, who found the back of the net to clinch the title. A Stanford goal to make it 14-12 with 18 seconds left helped the Cardinal only in the record books.

The championship win was Southern California's first since 2013, and the appearance alone marked the 14th straight for the Trojans. In that run, they are 8-6 in title games.

Stanford now falls to 10-11 in championship games and hasn't won the title since 2002, which extends the longest drought for the Cardinal in school history.

Read below to relive the game with realtime updates, stats and highlights throughout the championship:

In the first game of Saturday's semifinals, host team Stanford took down UC-San Diego. Though the lopsided final might imply otherwise, the two teams started out neck and neck. At halftime, the Cardinal led 7-5, but finished the game on a 9-2 run to secure the 16-7 win. Stanford advances to its first title game since 2008, which was also against USC. The Cardinal lost all four of their most recent championship appearances, with three of those losses coming to the Trojans. Stanford's last title came in 2002, when it beat California 7-6 to go back-to-back.

The second semifinal was a rematch of last year's championship between USC and UCLA. Just like last year, the game went back and forth for its entirety. UCLA jumped out to a 3-1 lead, but the game was tied 7-7 with under a minute to play. After USC forced a shot-clock violation on the Bruins, the Trojans called a timeout to set up their offense. The resulting play was a perfect entry pass to Sam Slobodien, who snuck one past UCLA goaltender Alex Wolf for his first score of the game with five seconds left. The 8-7 win avenged last year's championship loss, and put USC back in the championship game for an unbelievable 14th straight year. The Trojans have lost their last four, but won six in a row before that, with the latest coming in 2013