In one of the wildest matches in Gold Cup history, Mexico and Trinidad and Tobago played out a rollercoaster 4-4 draw in Charlotte on Wednesday night. In the final match of the group stage, Mexico had looked set to clinch top spot in Group C and a meeting with Panama in the quarterfinals when a Kenwyne Jones own goal put El Tri in front in the 90th minute. But further drama was still to come as Yohance Marshall secured Trinidad a share of the points and surely a just result after an incredible contest.

It was Trinidad who were left celebrating, though, having finished with seven points to finish first in the group. And it is they who will now meet Panama in Sunday’s first quarterfinal, while Mexico will play in the second match of the day against last year’s World Cup quarterfinalists Costa Rica.

For Mexico, aiming to regain the Gold Cup and earn a playoff with the United States for a place in the 2017 Confederations Cup, finishing second in a group they were expected to win with a degree of comfort represents a significant disappointment. The 2011 champions had been frustrated in a goalless draw with Guatemala in their previous match and early on there were signs that they may again struggle to turn their dominance of possession into goals.

But the pressure appeared to be alleviated when Paul Aguilar put them in front from a tight angle just past the half-hour mark. Despite losing forward Giovani dos Santos to injury at halftime, Carlos Vela expertly doubled the Mexican lead early in the second half and Miguel Herrera’s side were on course for a morale-boosting win.

But then came an extraordinary 12-minute spell in which Mexico’s back three and, in particular veteran Francisco “Maza” Rodríguez, were horribly exposed. It was Jones, suddenly producing the type of performance that once made him one of the Premier League’s hottest strikers, who was doing the damage, simply bullying a timid Mexico backline. After setting up Keron Cummings to pull a goal back, Jones added one himself with a crisp near-post finish to pull his team level. His strength then soon allowed Cummings to lash in his second with a stunning left-footed drive to put Trinidad in front and leave Mexico’s hopes of finishing top in tatters.

But the excitement was only just getting started. Andres Guardado replied with a sensational left-footed effort of his own to claw Mexico level once more with two minutes of regulation time remaining, before Jones cruelly turned Hector Herrera’s cross into his own net. It looked to be a huge let off for Mexico and under pressure coach Herrera, but he and his team were thrown back under intense pressure when their defense again failed miserably, allowing Marshall to head home a late corner.