HOUSTON –Deep into extra time — and deep into stoppage time of that 30-minute extra period — the Washington Spirit conceded an equalizing goal in the National Women’s Soccer League championship game Sunday.

The result of the impending penalty kick tiebreaker felt like a foregone conclusion.

And so after coming within 30 seconds of its first title, the Spirit fell to the Western New York Flash in the shootout, 3-2, following a 2-2 draw through regulation and overtime before 8,255 at BBVA Compass Stadium.

Crystal Dunn scored the second of her two goals in the first of the 30 extra minutes, but Lynn Williams, the league MVP, answered in the dying moments to force penalty kicks.

“We were so devastated because we had the game,” captain Ali Krieger said. “We were sitting pretty. We were strong. We were confident.”

“To give away a goal like that,” midfielder Christine Nairn added, “it’s hard to comprehend right now.”

In the tiebreaker, Sabrina D’Angelo stopped three of Washington’s five attempts. With her team trailing 3-2 in the fifth round, Spirit goalkeeper Kelsey Wys kept hope alive by saving Samantha Mewis’s bid. But D’Angelo dived to her left to thwart Diana Matheson’s attempt as the fourth-seeded Flash won its first title.

The late plot turn foiled the second-seeded Spirit’s attempt to become the first locally rooted pro team from the Washington area to win a league crown since D.C. United in 2004. (The Kastles have earned five World Team Tennis titles in seasons that last just four weeks each summer.)

Dunn, the 2015 MVP and rising U.S. national team star, had scored just two goals during a regular season interrupted by call-ups and the Olympics. But she put Washington ahead in the ninth minute. Mewis celebrated her 24th birthday with the equalizer five minutes later.

After the stirring start, the teams exchanged half-chances up to intermission. Opportunity dried up in the second half. Neither side budged. Rhythm was elusive. Passing faltered. Set pieces provided no relief.

But the match buzzed to life in extra time on Dunn’s goal and continued at a hectic pace.

Dunn collected Krieger’s pass unmarked just inside the penalty area and lifted an exquisite 16-yard shot into the near top corner. Washington then repelled threats for what seemed like eternity. But in the dying moments of extra time, Jessica McDonald sent a high ball from the left side into the heart of the penalty area. Wys came off her line. Williams rose between Nairn and Alyssa Kleiner and nodded the ball before the keeper arrived.

“My initial instinct was [Wys] didn’t need to come,” Spirit Coach Jim Gabarra said. “You take your chance of [Williams] beating a defender or two. … It’s good to have a goalkeeper that is confident coming off her line. I guess she felt like she could win it. … At the end of a match, players make a mistake when they are fatigued, and maybe that’s a mistake she made at the end there.”

Said Wys: “Maybe there was something I could’ve done differently.”

Sunday’s final capped the fourth NWSL season, the longest for a U.S. pro women’s soccer league after a pair of three-year failures (WUSA 2001-03 and WPS 2009-11). Commissioner Jeff Plush said the league has received several inquiries about expansion next year, a topic to be discussed at a board meeting next week. Additional teams are almost certain by 2018.

This year, the NWSL enjoyed a 10 percent increase in regular season attendance (5,558 average), despite no momentum from the U.S. team’s Olympic effort, which ended abruptly in the quarterfinals. Expansion Orlando set a league record with 23,403 for its home debut. Portland averaged 16,945 over the regular season — better than four MLS clubs — and drew 20,008 for a semifinal. Seven of the 10 NWSL teams, however, averaged fewer than 4,700.

The Spirit was the league front-runner most of the summer before fading at the end and settling for second place behind Portland. An extra-time triumph over Chicago last weekend in its first home playoff lifted Washington to its first title game.

Buoyed by an extra-time thriller against Portland, the Flash rode into the final with the league’s top attack. Gabarra altered his formation to disrupt the Flash’s rhythm, and for the most part, Washington was successful.

Opportunities flowed at the start.

The Spirit struck in the ninth minute. Megan Oyster played a well-weighted, 40-yard ball over the backline. Dunn turned on the burners and beat the charging D’Angelo to the ball at the top of the penalty area, chesting it forward. Before two retreating defenders could provide cover, Dunn one-timed a tight-angled shot into the net.

The lead lasted all of five minutes. Williams squared the ball to Mewis, who juked Nairn and placed a 23-yard shot into the lower right corner.

Gabarra turned to Matheson for a boost in the 81st minute, but extra time seemed unavoidable. The match snapped out of its doldrums at the start of the bonus period. After Dunn’s tiebreaking strike, the Flash attacked with urgency and menace, putting the Spirit on its heels in the box. Washington counter-punched with several threats.

All went according to plan for Washington until those last excruciating seconds.

“That’s obviously the worst feeling ever,” Dunn said, “knowing you are about to win.”

Krieger, Tori Huster and Matheson failed to convert their penalty kicks.

“It’s a difficult loss,” Gabarra said, “and it’s going to be very difficult for us for a long time.”

Spirit lineup: Wys; Oyster, Church, Zadorsky; Krieger, Nairn, Huster, Dydasco (Kleiner 22nd); Dunn, Ordega (Stengel 113th), Banini (Matheson 79th).

Dunn goal:

GOAL! Crystal Dunn strikes first for the Washington Spirit and they’re up 1-0 over WNY. #NWSLChampionship #WASvWNY https://t.co/TUrlrvd3JE
— FOX Soccer (@FOXSoccer) October 9, 2016

Mewis goal:

GOAL! Samantha Mewis answers back quickly for the Flash and we’re even at 1-1! We got a game on our hands! #WASvWNY https://t.co/W4QyeO7HqL — FOX Soccer (@FOXSoccer) October 9, 2016

Dunn goal:

GOAL! Crystal Dunn scores the fastest #NWSL extra time goal and puts the Spirit ahead of WNY, 2-1. #NWSLChampionship https://t.co/RdtCcnRugr
— FOX Soccer (@FOXSoccer) October 9, 2016

Williams goal:

GOAL! Stoppage time of extra time and Williams equalizes for the Flash! It’s 2-2 now and PKs loom. #NWSLChampionship https://t.co/DVBMoDsXlq
— FOX Soccer (@FOXSoccer) October 9, 2016