Peter Odemwingie scored the only goal to give Nigeria a victory that means World Cup debutants Bosnia-Hercegovina will not progress from Group F.
The Stoke forward struck in the first half to give Nigeria their first win at a World Cup finals since 1998.
The goal came just seven minutes after Bosnia striker Edin Dzeko had a goal incorrectly disallowed for offside.
Nigeria will reach the knockout stages if they get a point against Argentina, or if Iran fail to beat Bosnia.
Odemwingie’s decisive strike came just a month after he returned to the Nigeria squad following a two-year absence caused by adispute with coach Stephen Keshi.
Knowing they needed a win to stay in their first World Cup finals, Bosnia attacked from the start but were vulnerable in defence, with Odemwingie, John Mikel Obi and Michael Babatunde all squandering early chances for Nigeria.
Bosnia briefly thought they had taken the lead when Dzeko latched onto a pass from Miralem Pjanic, but the Manchester City forward was denied by an offside flag, though replays suggested he had timed his run well.
The Super Eagles made the most of the let-off as Emmanuel Emenike powered past Emir Spahic on the right before finding Odemwingie, who shot through the legs of his Stoke team-mate Asmir Begovic to score.