ZADAR, Croatia — First it was the World Cup soccer final. Now Croatia will meet France again to decide the Davis Cup, tennis’s premier team event.

After eight hours of action on Sunday, Borna Coric ended a sustained comeback bid from the United States by rallying from two sets to one down to beat Frances Tiafoe by 6-7 (0), 6-1, 6-7 (11), 6-1, 6-3 in the fifth and decisive match of a topsy-turvy semifinal.

“This is the most special moment of my whole life — by far,” Coric said. “If there were not,” fan support, “I would lose in the fourth set for sure, because my head was deep in the water.”

Earlier, the substitute Sam Querrey had rallied to keep the Americans alive.

Querrey, replacing Steve Johnson, beat sixth-ranked Marin Cilic, 6-7 (2), 7-6 (6), 6-3, 6-4 to even the best-of-five series, 2-2.