Mexico coach Miguel Herrera experimented with his line-up but the performance of his team will have disappointed an overwhelmingly Mexican capacity crowd of 60,707.
Edin Dzeko, whose two goals gave Bosnia a 2-1 win over Ivory Coast on Saturday, was a menace to the Mexican defence from the outset and went close to scoring three times in the opening eight minutes.
Mexico's first real chance came in the 24th minute with Javier Hernandez, given a start in attack, latching on to a fine ball from Miguel Layun and striking the outside of the post with a low shot.
However, Bosnia's deserved lead came, four minutes before the break, when Sejad Salihovic whipped in a ball from the byline and Hajrovic met it with a confident first-time strike.
A series of substitutions disrupted the game in the second half but Mexico began to pile on the pressure in the closing minutes as they sought to defend coach Miguel Herrera's unbeaten record.
Francisco Rodriguez's glancing header from an inswinging free-kick forced a great save out of Begovic and the Bosnia keeper was at full stretch again moments later to push a fierce Miguel Ponce long-range effort around the post.
"This is good for our confidence to beat Ivory Coast and then to beat Mexico in front of their great fans," Manchester City striker Dzeko told ESPN.
"We are prepared well for the World Cup. This is an amazing thing for our team and our small country, we have waited over 20 years for this and we want to do our best to make the second round - and then we will see."
Brazil face Croatia in the opening match of the tournament in Sao Paulo on June 12 with the final taking place in Rio de Janeiro on July 13.
- Sports & Recreation
- Asmir Begovic
- Edin Dzeko
- Ivory Coast
- Miguel Herrera