Stanford’s quest for its 11th men’s water polo NCAA championship and its first since 2002 fell short Sunday.

Despite a late surge, top-ranked Stanford fell to No. 3 USC 14-12 in the NCAA final at Stanford’s Avery Aquatic Center. It was the Trojans’ third win over the Cardinal in three matches this season, all at Stanford. The Cardinal (21-3) were unbeaten against everybody else.

USC’s title, its 11th overall, was its first since winning the last of six in a row in 2013.

USC (30-3) scored the first six goals of the match and led 12-4 early in the fourth quarter. But Stanford closed to within 13-10 with 2:19 left after two goals by Ben Hallock and one by Tyler Abramson.

In the closing minutes Hallock had a 5-meter penalty shot, but the ball slipped from his hand and he was unable to shoot. After Stanford’s Bennett Williams later converted a penalty shot with 58 seconds left to make it a two-goal game, USC’s Jake Ehrhardt scored to clinch the win with 31 seconds left.

A Hallock goal with 18 seconds remaining completed the scoring.

Hallock, the Mountain Pacific Sports Federation Player of the Year, scored five goals in the match. Williams added three goals for Stanford and Abramson two.

Tournament MVP Jacob Mercep scored five goals for the Trojans.

Stanford had advanced to the championship by defeating UC San Diego 16-7 on Saturday. USC reached the final by defeating UCLA 8-7, scoring the winner with five seconds left.