Jerrell Wright made three foul shots in the final 30 seconds, and the No. 13 seed Explorers survived after blowing an 18-point halftime advantage to beat fourth-seeded Kansas State 63-61 on Friday in the second round of the NCAA tournament.

Wright, who scored a game-high 21 points for the Explorers (22-9), made the first two free throws to give La Salle a 62-61 lead. Kansas State’s Jordan Henriquez missed in the paint at the other end, and Wright made the first of two more foul shots with 9.6 seconds to go.

The Wildcats (27-8) raced down court, looking for a tying basket, but point guard Angel Rodriguez got hung up in the corner near the Kansas State bench. His off-balance shot over the corner of the backboard missed everything, and the Explorers jumped off their bench to celebrate.

Ramon Galloway scored 15 of his 19 points in the first half, and Sam Mills added 10 points for La Salle, which beat Boise State in one of the First Four games just to reach Kansas City, and now has won two games in the NCAA tournament for the first time since 1955.

The Explorers will play 12th-seeded Mississippi, which knocked off No. 5 Wisconsin 57-46 earlier in the day, for a spot in the round of 16 in a suddenly shredded West Region.

Henriquez and Shane Southwell scored 17 points each for Kansas State, which trailed 44-26 at the break but managed to claw back into the game with some scrappy defense.

La Salle was just 3 for 18 from the field in the second half.

It turned out to be just enough.

Explorers coach John Giannini was worried his team would be weary after beating Boise State two days ago, so his guys hardly practiced Thursday. They made up for it by putting up extra shots before the game, when Kansas State headed to the locker room for final instructions.

Evidently, the Explorers got into quite the rhythm.

Galloway hit the first of his three first-half 3-pointers on La Salle’s opening possession, and he was followed in quick succession by Mills and Tyreek Duren, whose own shots from beyond the arc effectively silenced a partisan crowd that came dressed mostly in purple and white.

Kansas State coach Bruce Weber kept calling timeouts to implore his team to settle down, but nothing seemed to stick. During one break, with the Explorers already leading 21-9, the first-year coach clapped his hands and told his team as it arrived at the bench, “We’re fine!”

The Explorers pushed their lead to 35-16 late in the first half, and even when the Wildcats made back-to-back baskets — and their subdued fans started to stir — La Salle’s veteran backcourt was there to answer with a slicing layup or a fall-away jumper.

La Salle shot 58 percent and committed two turnovers in building a 44-26 halftime lead, while the Wildcats went 1 for 8 from beyond the arc and turned it over seven times.

Everything turned in the second half.

Those open 3-pointers the Explorers had been pouring in were replaced with brick shots and air balls, their weary legs starting to show. And those lousy passes and missed layups by Kansas State were replaced with crisp feeds for open looks around the basket.

Henriquez, the Wildcats’ 7-footer, started to take advantage of a six-inch advantage in the paint, scoring six points during their 20-5 run to open the half. When he checked out, bruising post player Thomas Gipson kept the pressure on, demoralizing the smaller Explorers.

Gipson’s basket in the paint drew Kansas State within 56-55, and then a put-back by McGruder gave the Wildcats their first lead of the game with 7:10 remaining.

Wright’s two foul shots with just over 4 minutes left in the game knotted it 60-all, and Henriquez’s free throw with 2:25 remaining gave Kansas State the lead. But McGruder missed a closely guarded jumper on the Wildcats’ next trip, and then rattled out a 3-pointer.

The misfires gave the Explorers the opening they needed to finish off a memorable upset.