The Barcelona superstar created the third-minute own goal by Sead Kolasinac with which Argentina went ahead, but it took a mid-match tactical shift for him to really start influencing proceedings.
In the 65th minute he scored a goal befitting of the iconic 78,800-seater stadium, collecting the ball deep and exchanging passes with Gonzalo Higuain before darting past a pair of defenders and slamming home via the base of the left-hand post.
It was only the second World Cup goal of the 26-year-old's career and substitute Vedad Ibisevic's late reply for Bosnia meant that it proved decisive.
With tournament debutants Bosnia likely to be Argentina's strongest rivals for group supremacy, Alejandro Sabella's side are firmly on course to reach the last 16 ahead of further games against Iran and Nigeria.
Victory was raucously celebrated by the swathes of blue and white-clad fans who had swept into Rio and turned the Maracana -- overhauled for the World Cup -- into an outpost of Buenos Aires, but it was far from straightforward.
With Higuain still troubled by an ankle injury, Sabella elected to deploy a 5-3-2 formation that paired Messi with Sergio Aguero in attack.
It was a departure from the 4-3-3 system used in qualifying, when Argentina topped the South American standings, but it did not stop Messi from making an early impression.
A free-kick wide on the left gave the Argentina captain a chance to bend a cross into the box and although Marcos Rojo made only glancing contact, the ball cannoned into the net off the unfortunate Kolasinac.
Clocked at two minutes and eight seconds, it was the quickest own goal in World Cup history.
- Tactical tweak frees Messi -
In characteristic fashion, Messi repeatedly dropped deep to collect the ball, but too often he ran down blind alleys or found himself crowded out.
Having overcome the shock of conceding such an early goal, Bosnia found that they were able to hold Argentina at arm's length with relative ease, and they grew bolder in attack.
Argentina goalkeeper Sergio Romero was solicited twice before half-time, saving bravely from Izet Hajrovic after a lofted pass by Zvjezdan Misimovic and then plunging to his left to repel a header from Senad Lulic.
The best Argentina could muster in response was a Javier Mascherano shot that Asmir Begovic boxed away.
Sabella took decisive action at half-time, sending on Higuain and Fernando Gago for Maxi Rodriguez and Hugo Campanaro and reverting to the tried and tested 4-3-3.
Initially it was Bosnia who continued to press, with Hajrovic twice working Romero from range.
But Messi was beginning to see more of the ball, and he twice teed up Aguero, who blazed wildly over before testing Begovic with a side-foot shot.
A ballooned free-kick suggested that Messi was still feeling his way into the tournament, but moments later he announced his arrival in style with Argentina's second goal.
Ibisevic reduced the arrears with five minutes to play, squeezing a shot between Romero's legs and over the line, but Argentina managed to see the game out. (AFP)