In an FCIAC tournament semifinal round boys soccer game that seemed poised to shift completely Trumbull High’s way, only to turn toward Danbury High, coach Sebe Gangemi’s second-seeded Eagles defeated the third-seeded Hatters 3-2 at Fairfield Ludlowe’s Taft Field on Tuesday night.

Trumbull (14-0-4) will take on top-seeded and Greenwich (15-0-3) in Thursday night’s championship game at Norwalk High.

The top-seeded Cardinals defeated fifth-seeded Fairfield Warde, 2-1 in their semifinal match.

Trumbull built a 3-1 halftime lead and narrowly missed making it a 4-1 cushion, which would have matched the final score of its regular-season win over Danbury (11-3-4) only about a minute into the second half. A header deflected just over the top of the goal.

Danbury escaped and proceeded to pick up the pace and dominate the chances for a bulk of the final 40 minutes, closing to within a goal eight minutes into the half.

The Hatters then nearly forced overtime with a last-second blast that was deflected over the top of the crossbar by Trumbull goalkeeper Jonathan Campbell.

The Trumbull bench held its collective breath as the ball sailed off the foot of Danbury’s Ricardo Rodriguez, who scored Danbury’s second goal. Then came the celebration as Campbell knocked the ball over the top just as time ran out. “I’m very proud of my boys not giving up,” said Campbell, who made nine saves.

“The clock wasn’t fast enough to tell you the truth,” Gangemi said of pretty much the entire second half countdown. “I’m very pleased. They held on nicely and tight. We went at them in the first half,” the coach said.

Matthew Restrepo gave Trumbull the lead five minutes in, to start a rapid-fire sequence of scoring. His tally came off a Connor Jorge assist and was Trumbull’s first shot.

Danbury’s Kaike Nascimento answered in the next minute.

Trumbull’s Jason Weinstein, set up by Thang Dao, got the Eagle lead back only one minute later, six minutes into the contest.

Dao, assisted by Chris Lancia, and following a Noah Warren throw-in, made it 3-1 in the 35th minute.

“I’m really pleased. We worked so hard for eighty minutes. We just kept pushing and pushing,” said Dao, adding that the Hatters deserve a lot of credit for battling back. “I can’t believe we’re in the finals now. It feels really good — it’s amazing.”

Trumbull generated a quality chance to answer Danbury’s second goal when Restrepo made a nice run up the left wing and got the ball to Jorge, who crossed to Weinstein in the 18-yard box. Weinstein was stopped on an initial shot and a follow-up opportunity.

The Hatters came back the other way and kept pressuring the Trumbull goal.

Gangemi joked that he lost a few hairs off his head, but acknowledged that this was an exciting game. “It was a great game – worthy of an FCIAC semifinal,” Gangemi said.