What was meant to be a friendly game to help Lionel Messi’s Inter Miami sharpen up for the recently restarted Major League Soccer (MLS) season on Thursday night ended up a lesson in bad pitchside security.

Inter Miami lost its MLS season opener 3-0 to LAFC last weekend and travelled to Bayamón, Puerto Rico, to play top-flight Ecuadorian club Independiente del Valle on Thursday night. The exhibition match was initially intended to be part of their preseason earlier in the month, but was rearranged because Messi had hamstring issues.

Messi was substituted on by head coach Javier Mascherano just after half-time with the game tied 1-1, and scored the winning penalty as Inter Miami won 2-1.

But it was the scenes towards the end of the game, with fans breaking onto the pitch to reach Messi, that ended up drawing the focus.

A security guard chases a fan who had run onto the pitch to greet Lionel Messi

A security guard chases a fan who had run onto the pitch to greet Lionel Messi at Estadio Juan Ramón Loubriel in Bayamon, Puerto Rico. (Leopoldo Smith/Getty Images)

It was perhaps a sign of the disorganisation to come that both teams appeared in clashing black kits in front of the sold-out Estadio Juan Ramón Loubriel of 12,500 people. There was plenty of pink in the stands, though, and the crowd erupted after Messi’s penalty.

This was a rare chance for many to see their hero in person as he had never played in Puerto Rico before.

Watching Messi wasn’t enough for some, though, as fans took to the pitch to try and meet him towards the end of the game.

The disruption started in the 88th minute during an Independiente del Valle attack, as the first fan ran onto the pitch. You can spot him to the top right of the picture below, wearing a white T-shirt.

The pitch invader then takes his top off as if he’s just scored a screamer and makes a beeline for Messi, who is standing inside the centre circle.

Players could only watch as the fan was chased by a security guard, who is pictured below approaching the halfway line and wearing grey trousers.

As the security guard focuses his attention on the initial pitch invader, others sneak on to the field and make a beeline towards Messi.

One here, in a 2008-09 Barcelona jersey, runs towards Messi unnoticed (he is seen just entering the centre-circle).

Messi courteously signs the two shirts of the fans who reach him as the fan in the Barcelona jersey comes prepared with a marker and also snags a selfie. Then again, there wasn’t much else Messi could do with no security around to help him.

The other players, hands on hips with the game paused, look unimpressed at the interruption.

Back to the fan who took his top off. He manages to loop around the security guard chasing him and now, with no T-shirt on to sign, decides to hug Messi from the side.

After being given the run around by this fan, the security guard grabs him by the waist and looks to tackle him to the ground. The only issue is that the fan doesn’t let go of Messi, meaning all three of them are pulled to the ground.

Messi gets up without harm but looks bewildered about what just happened.

By this point, many more security personnel have belatedly entered the pitch and chase off the remaining invaders, a lot of whom look like kids.

It’s possible Messi’s now-famous bodyguard, Yassine Cheuko, was preventing other invaders elsewhere, but he wasn’t spotted in the images and maybe wasn’t at the game. Not that this failure was down to any one person. This was a full security breakdown to allow this many pitch invaders enter the playing surface, and to offer Messi no protection.

The game was eventually restarted and finished, with two extra minutes added to account for the stoppage in play.

Inter Miami face a turnaround of less than 72 hours as they return to MLS action on Sunday evening, playing Orlando City.

It was honourable of them to commit to rearranging the fixture so the Puerto Rican fans could see Messi, and the pitch invasions were unfortunate acts of overenthusiasm. Regardless, many in attendance would have gone home with a cherished experience of watching the Argentine great.