DES MOINES — In a game where the difference was the smallest of margins, veteran presence proved to be the deciding factor.

For 28 minutes, AGWSR and Exira/Elk Horn-Kimballton were in a blinking contest that looked like neither team was going to flinch

The game was tied or saw the lead change 17 times.

Then, one of the teams did flinch.

Exira/EH-K (24-1) used an 8-0 run to start a 14-4 finish as the Spartans advanced to the Class 1A state semifinals for the second consecutive year with a 57-47 victory over the Cougars Wednesday at Wells Fargo Arena.

“I’m super proud of the way we fought,” said AGWSR senior Mandy Willems. “It is not where we wanted to end, but we battled to the very end.”

Led by a pair of seniors — Kealey Nelson and Sophia Peppers — who had played substantial minutes for Exira/EH-K during its previous three trips to the state tournament, the Spartans made the key plays down the stretch.

AGWSR’s Alyssa Hames tied the game at 43 with 4:25 left on a nice inside hoop. But Peppers, who led all scorers with 24 points, converted a conventional three-point play with 4:08 left and seconds later Nelson scored on a steal and lay-up. The Spartans never trailed again.

“We kind of panicked a little bit,” AGWSR head coach Laurie Gann said.

As the Cougars wobbled slightly, the Spartans played with the confidence of having been here and done that.

Gann said that was important.

“Quite honestly coming into the game I didn’t know if we’d panic at the beginning of the game,” Gann said. “Once we started getting a little tired some of those mental mistakes came out. I just think a little bit of that experience of them being in those situations here before probably played into their hands.”

For the first 28 minutes, the Cougars, making their first appearance since winning it all in 2009, gave Exira/EH-K everything it could handle.

AGWSR led by six midway through the first quarter, 13-12 after the first period and 27-26 at halftime.

It looked like the Spartans were taking control when Peppers scored six of an 8-0 run that took Exira/EH-K from down 31-28 to a 36-31 lead with 4:11 left in the third.

But AGWSR responded with an inside hoop by Taryan Barrick and a 3-pointer by Willems to retie it at 38-all with 2:22 left in the third.

The Cougars, however, led just once in the fourth, 41-40.

“We just weren’t getting the good shots we had been getting in the fourth,” junior guard Aubrie Fisher said. “We played the game we wanted. We wanted to be physical. We wanted to make it hard for them and we did that, too. They just made a few more plays.”

Willems, who had hit almost 50 percent of her 3-point shots in the regular season, led the Cougars with 14 points, but the Spartans made her work for them with a diamond-and-one defense.

Rarely did she have time and space to shoot, finishing 4 of 20 from the field and 2 of 11 from behind the 3-point line.

Exira-EHK 57, AGWSR 47

AGWSR (21-3) — Ally Finger 2-4 0-0 5, Mandy Willems 4-20 4-4 14, Aubrie Fisher 3-7 0-0 7, Taryan Barrick 4-10 0-0 8, Rachel Sicard 3-6 2-3 8, Alyssa Hames 2-2 0-0 4, Tori Brandt 0-0 0-0 0, McKenna Kuper 0-2 1-2 1, Whitanie Nederhoff 0-0 0-0 0. Totals 18-51 7-9 47.

EXIRA/EH-K (24-1) — Tatum Grubbs 1-3 1-2 4, Ellie Schultes 1-7 0-0 3, Kealey Nelson 6-11 6-8 18, Sophia Peppers 5-13 14-16 24, Kamryn Waymire 2-7 0-0 6, Jacey Anthofer 0-0 0-0 0, Leslie Caniglia 1-2 0-0 2. Totals 16-43 21-26 57.

AGWSR 13 14 11 9 — 47

Exira-EHK 12 14 14 17 — 57

3-point goals — AGWSR 4-21 (Finger 1-3, Willems 2-11, Fisher 1-5, Sicard 0-1, Kuper 0-1). E/EHK 4-18 (Grubbs 1-3, Schultes 1-5, Peppers 0-4, Waymire 2-6). Rebounds — AGWSR 27 (Willems 8). E/EHK 35 (Peppers 9). Assists — AGWSR 11 (Fisher 5). E/EHK 10 (Peppers 4). Turnovers — AGWSR 16 (Willems 9). E/EHK 17 (Schultes 6). Total fouls — AGWSR 21, E/EHK 10. Fouled out — Finger.