ARLINGTON, Texas (AP) — Clint Dempsey grew up playing youth soccer in the Dallas area, nearly 200 miles from his Texas hometown.

Back in his home state and coming off the bench, Dempsey matched the American international scoring record and sparked the U.S. to a spot in the CONCACAF Gold Cup title game.

Dempsey fed Jozy Altidore for the go-ahead goal not long after entering, then scored on a free kick to match Landon Donovan with his 57th international goal Saturday night in a 2-0 semifinal win over Costa Rica.

"This has to be the best in Texas for me, since I tied the record and it was an important game," the 34-year-old forward from Nacogdoches.

Dempsey entered in the 66th minute and made a perfectly timed through pass six minutes later that allowed Altidore to break in alone and beat goalkeeper Patrick Pemberton with a left-footed shot from 10 yards.

Dempsey doubled the lead in the 82nd minute with a 27-yard shot that went around a four-man defensive wall that got past Pemberton on two bounces.

"I saw the keeper cheating a little bit, and it went in," Dempsey said.

Dempsey has 136 international appearances, trailing only Cobi Jones (164) and Donovan (157) among American men. The assist was his 20th for the national team.

"Coming back from two heart procedures, being able to still play at this level," Dempsey said in his Texas twang, "living a dream. So I'm happy."

After starting in Wednesday's quarterfinal win over El Salvador, Dempsey moved to a reserve role against the Ticos. While the U.S. inserted five new starters in a roster rotation, Costa Rica went with the same 11 who opened in Wednesday's win against Panama.

"I know it's something that was important to Clint, and to score that goal in a big game makes it even more special for him," coach Bruce Arena said.

Arena said the plan all along was to have Dempsey enter the semifinal between the 60th and 70th minutes, to provide a spark when legs got heavy.

"He thought it was going to be a tight game, and they'll bring me on late and it'll open up," Dempsey said. "He was right with what he said. It's always going to be a little difficult to try and go 90 three days after going 90 against El Salvador, so I was happy with the decision."

Trying for their sixth Gold Cup title and first since 2013, the Americans play Mexico or Jamaica in the final on Wednesday at Santa Clara, California.

The U.S. improved to 8-0-5 since Arena replaced Jurgen Klinsmann in November and returned for a second stint as national team coach. Arena can become the first coach to win three Gold Cup titles following championships in 2002 and 2005.

Tim Howard got his second straight shutout and 42nd overall for the U.S., making key saves on Marco Urena in the 37th and 71st minutes.

After the second save, Dempsey took a pass from Darlington Nagbe in the center circle, made a cut, and took three touches as he sprinted toward goal. Altidore one-timed a shot for his first national team goal since September and ripped off his No. 27 jersey in a wild celebration, earning a yellow card.

Dempsey's goal sealed the win, putting the U.S. back in the final after a shocking semifinal loss to Jamaica two years ago. He was playing for the first time in AT&T Stadium, the $1.2 billion home stadium of the NFL's Dallas Cowboys.

"Look, Clint's ability to impact a game with goals, assists at the highest level is nothing new," American captain Michael Bradley said. "Bruce felt like for tonight his ability to come off the bench and come into a game, that maybe had started to open up a little bit, was going to make a difference and it sure did."

Dempsey said he bought 27 tickets for the game and saw many more people from his hometown.

"Congratulations, Clint. Feel free to stop now. We'll share it together," Donovan said while commentating during the Fox telecast.

Costa Rica routed the U.S. 4-0 at home in a World Cup qualifier in November, the final game before Klinsmann was fired and Arena was brought back. And up ahead is another matchup, a qualifier on Sept. 1 at Harrison, New Jersey.

Jordan Morris, who replaced Dempsey, was among five new starters and hit a post just 11 seconds in. Arena didn't want Dempsey playing three full matches in an eight-day span.

Dempsey hopes to play in a fourth World Cup next year.

"He understands where he is in his career," Arena said. "There's going to be games he'll start, games where he'll play the role he played tonight. Things can change in other directions, but that's the plan right now."