Messi lifted Argentina in the 65th minute, moving in from the right and striking a low left-footed shot off the inside of the post behind Bosnian keeper Asmir Begovic. It was Messi's second World Cup goal, adding to one he scored eight years ago in Germany.
Vedad Ibisevic scored a close-in goal in the 85th to give Bosnia hope.
Argentina took a 1-0 lead in the third minute on an own-goal by defender Sead Kolasinac. For the remainder of the half, Argentina showed little with Messi seldom touching the ball and Bosnia — a World Cup debutant — looking more threatening.