Ex-Cosmos forward Jairo Arrieta had plenty of reasons to celebrate Tuesday night. (Dennis Schneidler/USA TODAY Sports)

Former Cosmos forward Jairo Arrieta was the toast of the town in Heredia, Costa Rica Tuesday night.

Arrieta scored the equalizing goal three minutes into stoppage time to give Herediano a dramatic 2-2 comeback tie with Tigres in the CONCACAF Champions League Round of 16 first leg at Estadio Eladio Rosabal Cordero Tuesday night.

The former Costa Rican international played for the Cosmos in 2016, when they captured their third North American Soccer League crown.

With the hosts trailing by two goals and time running out, Yendrick Ruiz converted a 90th-minute penalty kick past goalkeeper Nahuel Guzman to slice the lead in half after Timothee Kolodziejczak was called for handball in the penalty area.

Three minutes into injury time, Arrieta headed home Elias Aguilar’s free kick from close-range to equalize only seconds before the final whistle.

Tigres, the CCL runners-up the past two years, pushed forward early on, playing as though it was the hosts. The Mexican team’s ploy paid off in the 14th minute when Francisco Meza slipped home a corner kick off Kolodziejczak’s flicked header past keeper Leonel Moreira.

Lucas Zelarayan, who almost scored after banging a 16-yard shot off the left post in the 27th minute, gave Tigres a 2-0 advantage in the 59th minute, knocking home Jurgen Damm’s right-wing cross at the far left post.

Until the final minutes, Guzman was solid in the net, denying Randall Azofeifa from point-blank range in the 51st minute and Aguilar’s free-kick attempt a minute later.

The second leg will be played in Mexico Feb. 27.