TUCSON, Ariz. (AP) — They can't call him "one-and-Dunphy" anymore.

Juan Fernandez sank an off-balance 18-footer with less than a second to play to hand Temple a wild 66-64 victory over Penn State and end coach Fran Dunphy's NCAA tournament record 11-game losing streak.

Fernandez, double-teamed as time was running out, forced up the winning shot off his right foot while fading to his left just inside the 3-point line. The clock read 0.4 seconds as the ball went through the net.

Neither team had led by more than four points and there were 10 lead changes in an intense second half. Talor Battle's 3-pointer from far behind the arc for Penn State tied it at 64-64 with 12.2 seconds to go.

Fernandez and Ramone Moore scored 23 points each for the seventh-seeded Owls (26-7). Battle scored 23 for the 10th-seeded Nittany Lions (19-15) in their first NCAA tournament appearance in a decade.

It was the 92nd meeting between the instate rivals.

Dunphy's teams, first at Penn and the last three at Temple, had lost a tournament record 11 straight games before successfully escaping Thursday's thriller.

Fernandez, whose two free throws with 28 seconds left put Temple ahead 64-61, scored 17 of his season-high 23 in the first half, when the Owls rallied from an early nine-point deficit to take a 35-33 halftime lead.

The junior from Argentina, who missed playing time with a concussion in late January, was coming off one of his worst games of the season, making 3 of 17 shots and 1 of 7 3-pointers and scoring just seven points in Temple's 58-54 loss to Richmond in the Atlantic 10 championship game.

Moore scored 17 of his 23 in the second half. His 15-footer put the Owls ahead 62-61 with 1:10 to go and set up the wild finish.

On Penn State's subsequent possession, Battle drove the lane but his shot was blocked by Rahlir Jefferson, and Temple came away with the ball.

Battle, the second-leading scorer in the Big Ten, made three of his four 3-pointers to lead the Nittany Lions to a 20-11 lead. In his final game with Penn State, he finished 9 of 21 shooting, 5 of 11 on 3-pointers.

The Nittany Lions lost starting forward Jeff Brooks barely a minute into the second half with a dislocated right shoulder, the same injury that sidelined him for 10 days earlier this season.

Forward Scootie Randall was in the Temple starting lineup after missing the last seven games with an injured right foot but played just six scoreless minutes.

Fernandez, who averages 10.7 points per game, made 6 of 7 shots, including 2 of 3 3s, in his 17-point first half.

The Owls scored more points in the first half than Penn State allowed in its 36-33 victory over Wisconsin two games earlier in the quarterfinals of the Big Ten tournament.