Wales manager Chris Coleman lost his first home game in charge as a goal in each half gave Bosnia-Hercegovina a comfortable win in Llanelli.
Miroslav Stevanovic robbed Neil Taylor to deliver the opener on a plate for Vedad Ibisevic.
Stevanovic doubled the lead early in the second half when a counter-attack exposed the Wales defence.
Joe Allen came closest for the hosts when his early shot was tipped onto the bar by Asmir Begovic.
There were few other openings from the home side, and certainly this was far from the performance the manager wanted.
The friendly was Wales' final match before their opening 2014 World Cup qualifying game against Belgium on 7 September.
Wales were sluggish in possession, and there was further evidence of their dependence on Gareth Bale to provide the attacking threat.
Bale offered only fleeting glimpses of his pace and power, although he rose well in the first half to force Begovic, the Stoke City keeper, to save well.
Apart from injured goalkeeper Wayne Hennessey, Coleman could have fielded his strongest line up.
He chose not to start with Steve Morison, however, who had become the regular starter in the lone striker role and Simon Church was on the left wing in place of Craig Bellamy.
Hennessey's replacement, Boaz Myhill, was called into action with only 30 seconds on the clock to save Edin Dzeko's rising shot from six yards.
Both sides hit the bar in the opening 16 minutes of a busy opening.
Allen was the first to be denied by a superb fingertip save from Begovic, and then Bosnia defender Boris Pandza crashed a header against the Welsh bar.
Wales were almost punished when only a crucial deflection prevented Dzeko from troubling Myhill again.
But there was no second let-off when Neil Taylor failed to clear on Wales' left flank to allow Stevanovic to create Bosnia's opener.
The winger's low cross into the six-yard box was comfortably converted by Ibisevic to give the visitors a deserved lead on 21 minutes.
He came within inches of doubling the advantage when Aaron Ramsey was caught in possession, but the Stuttgart forward shot wide with only Myhill to beat from inside the box.
Wales, who had won both previous visits to Parc y Scarlets, were off the pace for the start of the second half and the visitors profited again to score the second.
The home defence was horribly exposed by a quick counter-attack down Bosnia's right flank, allowing Stevanovic to run unopposed into the area before unleashing a thunderous shot to the far corner.
Bellamy, replacing the ineffective Church, added some late impetus but Begovic was again firm to save the Cardiff City winger's low drive.
Joel Lynch came on to make his Wales debut and Morison, another late substitute, headed wide from a corner.
But Bosnia, looking for a first win in seven games, looked the more likely scorers in the final stages, with the best chances falling to Dzeko.
The Manchester City striker troubled the home defence throughout and exemplified Bosnia's technical superiority.
Wales will need significant improvement when they host Belgium in Cardiff as they head into the first qualifier on the back of a third consecutive defeat.Continue reading the main story
Sorry, we were unable to load match stats, please try again.
Live Text Commentary
Full Time The final whistle goes and the game is over.89:47
Shot by Edin Dzeko from outside the area goes high over the crossbar.87:48 Substitution
Substitution Robert Earnshaw is brought on as a substitute for Andrew Crofts.85:38 Substitution
Substitution Damir Vrancic comes on in place of Adnan Zahirovic.85:38 Substitution
Substitution Ognjen Vranjes replaces Mensur Mujdza.85:24
Effort from deep inside the area by Edin Dzeko misses to the left of the target.81:12 Substitution
Substitution Ivan Sesar comes on in place of Miralem Pjanic.80:18
Corner taken right-footed by Craig Bellamy, Close range headed effort by Steve Morison misses to the right of the goal.77:35
Corner taken left-footed by Sejad Salihovic from the right by-line, Boaz Myhill makes a save.77:08 Substitution
Substitution Darcy Blake leaves the field to be replaced by Joel Lynch.76:16
Edin Dzeko takes a shot. Save made by Boaz Myhill.75:28
Aaron Ramsey challenges Mensur Mujdza unfairly and gives away a free kick. Free kick taken by Mensur Mujdza.73:36
Inswinging corner taken left-footed by Sejad Salihovic, Miralem Pjanic takes a shot from close in clearing the crossbar.73:36 Substitution
Substitution Muamer Svraka on for Vedad Ibisevic.72:53
Effort on goal by Craig Bellamy from 20 yards. Save by Asmir Begovic.71:20
Foul by Mensur Mujdza on Craig Bellamy, free kick awarded. Craig Bellamy crosses the ball in from the free kick, Toni Sunjic manages to make a clearance.70:18
Free kick taken by Muhamed Besic.70:18 Substitution
Substitution Toni Sunjic comes on in place of Boris Pandza.70:18
Joe Allen concedes a free kick for a foul on Sejad Salihovic.68:16
Indirect free kick taken by Asmir Begovic.
Substitution Chris Gunter goes off and Samuel Ricketts comes on.68:16 Substitution
Substitution Steve Morison comes on in place of Sam Vokes.68:16
The referee blows for offside.67:54
Sejad Salihovic gives away a free kick for an unfair challenge on Hal Robson-Kanu. Aaron Ramsey takes the free kick.67:30
Joe Allen takes a shot. Save made by Asmir Begovic.66:40
The assistant referee flags for offside against Craig Bellamy. Free kick taken by Boris Pandza.64:59
Craig Bellamy takes a shot. Blocked by Mensur Mujdza.62:47
Mensur Mujdza takes the outswinging corner, free kick awarded for a foul by Boris Pandza on Andrew Crofts. Aaron Ramsey takes the direct free kick.61:29 Substitution
Substitution Senad Lulic leaves the field to be replaced by Muhamed Besic.61:29 Substitution
Substitution Simon Church goes off and Craig Bellamy comes on.61:29 Substitution
Substitution Hal Robson-Kanu comes on in place of Gareth Bale.57:26
Miralem Pjanic takes a corner.56:11
Shot from just outside the box by Miralem Pjanic goes over the target.55:11
Free kick awarded for a foul by Simon Church on Edin Dzeko. Direct free kick taken by Boris Pandza.53:16
Miralem Pjanic provided the assist for the goal.53:16 Goal scored
Goal! - Miroslav Stevanovic - Wales 0 - 2 Bosnia-H Miroslav Stevanovic fires in a goal from inside the area to the bottom left corner of the goal. Wales 0-2 Bosnia-Herzegovina.52:22
The referee blows for offside. Chris Gunter takes the indirect free kick.48:56
Corner taken by Sejad Salihovic from the left by-line to the near post.46:23
Foul by Boris Pandza on Sam Vokes, free kick awarded. Free kick taken by Boaz Myhill.45:58
Outswinging corner taken from the right by-line by Miralem Pjanic.45:04
Ashley Williams challenges Vedad Ibisevic unfairly and gives away a free kick. Strike on goal comes in from Sejad Salihovic from the free kick.45:01
The referee gets the second half started.45:00 +1:50 Half time
Half Time The referee blows for half time.45:00 +1:10
Free kick taken by Aaron Ramsey.45:00 +1:10 Booking
Booking Booking for Boris Pandza for unsporting behaviour.45:00 +1:06
Unfair challenge on Aaron Ramsey by Boris Pandza results in a free kick.45:00 +0:09
Vedad Ibisevic fouled by Andrew Crofts, the ref awards a free kick. Miralem Pjanic takes the direct free kick.43:36
Gareth Bale has an effort at goal from a long way out that goes wide left.42:35
Free kick awarded for an unfair challenge on Joe Allen by Miroslav Stevanovic. Ashley Williams takes the free kick.39:22
The assistant referee signals for offside against Simon Church. Mensur Mujdza takes the free kick.38:17
Corner from the left by-line taken by Sejad Salihovic, Headed effort from deep inside the penalty area by Emir Spahic goes harmlessly over the crossbar.37:56
Edin Dzeko takes a shot. Blocked by Ashley Williams.35:25
Gareth Bale takes a shot. Save by Asmir Begovic.34:32
Gareth Bale takes a shot. Emir Spahic gets a block in.33:24
Sejad Salihovic challenges Joe Allen unfairly and gives away a free kick. Joe Allen takes the direct free kick.31:59
Shot by Gareth Bale. Save by Asmir Begovic.31:02
Sejad Salihovic takes a shot. Darcy Blake gets a block in.30:15
The referee blows for offside against Sam Vokes. Asmir Begovic restarts play with the free kick.26:57
Vedad Ibisevic has an effort at goal from deep inside the area missing to the right of the target.25:59
Ashley Williams gives away a free kick for an unfair challenge on Edin Dzeko. Miralem Pjanic takes the free kick.24:59
Unfair challenge on Aaron Ramsey by Adnan Zahirovic results in a free kick. Aaron Ramsey restarts play with the free kick.23:21
Adnan Zahirovic concedes a free kick for a foul on Joe Allen. Joe Allen takes the free kick.20:10
Miroslav Stevanovic provided the assist for the goal.20:10 Goal scored
Goal! - Vedad Ibisevic - Wales 0 - 1 Bosnia-H Vedad Ibisevic finds the net with a goal from inside the six-yard box to the bottom right corner of the goal. Wales 0-1 Bosnia-Herzegovina.19:33
Simon Church fouled by Sejad Salihovic, the ref awards a free kick. Joe Allen restarts play with the free kick.15:33
Corner taken by Sejad Salihovic, Boris Pandza takes a shot.15:12
Effort from the edge of the penalty area by Edin Dzeko goes wide of the left-hand post.13:42
Corner taken by Miralem Pjanic from the left by-line, Senad Lulic has an effort at goal from deep inside the area missing to the left of the goal.10:38
Outswinging corner taken by Sejad Salihovic, Edin Dzeko challenges Ashley Williams unfairly and gives away a free kick. Boaz Myhill restarts play with the free kick.8:21
Corner taken by Aaron Ramsey, Joe Allen takes a shot. Save by Asmir Begovic.7:03
Edin Dzeko fouled by Andrew Crofts, the ref awards a free kick. Free kick taken by Mensur Mujdza.6:36
Miralem Pjanic takes the inswinging corner, clearance made by Gareth Bale.5:46
Free kick awarded for a foul by Darcy Blake on Vedad Ibisevic. Miralem Pjanic has a direct shot on goal from the free kick.4:39
Sejad Salihovic gives away a free kick for an unfair challenge on Chris Gunter. Free kick taken by Boaz Myhill.3:40
Foul by Simon Church on Mensur Mujdza, free kick awarded. Mensur Mujdza restarts play with the free kick.1:59
Unfair challenge on Joe Allen by Adnan Zahirovic results in a free kick. Direct effort from the free kick comes in from Gareth Bale.0:50
Short corner taken by Miralem Pjanic.0:31
Edin Dzeko takes a shot. Save made by Boaz Myhill.0:00
The referee gets the game underway.
Live data and text provided by our data suppliers