Wales defeated Turkey 2-0 with goals at the end of each half and even managed to overcome a missed Gareth Bale penalty.
Wales fully deserved their win although their initial failure to tale chances could have proved costly had Turkey not rallied until late in the second half.
The loss for Turkey means they cannot finish in the top two of Group A. They managed to avoid falling behind to Wales and looked to have steadied the ship before Aaron Ramsey struck just before the break.
Bale sent a brilliant pass to Ramsey who clipped in the opener for his 17th goal for his country which made amends for missing an earlier easier chance.
Turkey had a chance to level through their captain Burak Yilmaz but he squandered the opportunity on 54 minutes.
The game was fairly even then Wales were awarded a penalty which should have calmed the nerves but Bale fired over the top.
Keeper Ward made some routine saves to keep Wales in the game as Turkey took heart from the missed penalty although the Welsh also had their moments to make the game safe.
But it was not until deep into stoppage time that Wales clinched the win as Bale drifted down the by-line to square the ball to Roberts for a simple close range finish which should ensure they qualify for the knock-out stage.
Wales now face Italy in the final group game.
Wales: 2 (Ramsey 42, Roberts C. 90)
Baku Olympic Stadium, Baku
Man of the Match:Gareth Bale (Wales)