Argentina went in front in the Group F encounter after just three minutes thanks to an own goal from Sead Kolasinac, but they struggled to carve out further chances in an uninspiring first half.
There was a moment to cherish in the second half though, as Messi doubled Argentina’s lead in the 65th after gliding past a couple of defenders before finishing exquisitely.
World Cup debutants Bosnia kept fighting and Vedad Ibisevic reduced their arrears with six minutes remaining to set up a tense finale, but Argentina held on to take control of Group F.
For the Bosnians, playing in their first major tournament as an independent nation, there could not have been a much crueller start to their World Cup debut.
Messi could at least claim the assist, his free-kick from the left flicked off a head and bounced off Schalke defender Kolasinac's shin and in.
The stadium clock read 2min 10secs, and the goal was the cue for Argentina fans to embark on joyous, deafening celebrations that lasted much of the fairly uneventful first half that followed.
"Maradona is better than Pele," they sang, taunting the Bosnian-supporting Brazilians who sprinkled the stadium.
They were not singing about Messi at half-time because that free-kick and one trademark swivelling, snake-hipped run aside, Barcelona's gentle genius had a pretty dreadful first half, conceding possession too often and appearing lethargic off the ball.
Bosnia, by contrast, picked themselves up from that early knock-down and were terrific, unlucky not to equalise through Lazio striker Senad Lulic's superb header which was well saved low to his left by Monaco goalkeeper Sergio Romero, while Edin Dzeko clipped a shot over from a promising position in the 'D'.
A 'rabona' by Angel di Maria lifted Argentinian spirits - it was cleared to Javier Mascherano, who unleashed a shot from 25 yards and Asmir Begovic was glad that it was straight at him.
It was perhaps a sign of how well Bosnia had played that Argentina coach Alejandro Sabella made a double substitution at half-time, changing to a more positive 4-3-3 formation.
The impact was apparent and what had been a dull, defensive game opened up.
Bosnia were not prepared to settle for a negative part in that script however, and Izet Hajrovic's free-kick was on target but easily saved, and the Galatasaray player curled in another effort that was also too easy for Romero.
Messi appeared to relish the extra support, setting up Sergio Aguero only for Manchester City striker to slice it embarrassingly high and wide.
More quick feet after a loose Hajrovic pass saw Messi set up Aguero again: this time he was on target but Begovic was barely tested.
A free-kick 30 yards from goal was in Messi territory, but he lofted it too high.
Then came the moment much of the world has been waiting for: a classic Messi goal, and one that will be replayed again and again.
Picking up the ball with Bosnia players blocking his path, Messi played a one-two with substitute Gonzalo Higuain and then embarked on one of those trademark runs across the area, leaving defenders flailing in his wake before slotting a low shot in off the post.
Bosnia were pole-axed, Aguero came close to piling on the agony as Messi revelled in the extra space, and himself hit the side-netting.
Ibisevic made it interesting with six minutes left, a canny run allowing him to clip the ball past Romero. But this was destined to be Messi's night, and so it proved.