Wakaso Mubarak starred as Ghana beat Togo 3-1 on Wednesday to book their place in the Africa Cup of Nations finals.
Having fallen to a 1-0 defeat at Uganda on Saturday, Ghana headed into their final AFCON qualifying Group E clash needing at least a point to progress to the biennial tournament - slated to start in Equatorial Guinea in January.
And the managerless Black Stars did enough to pick up all three points at the Tamale Sports Stadium, with Wakaso playing a crucial role in their victory.
The Celtic winger first provided the assist for Abdul Majeed Waris to head home his first international goal in 13 months, before doubling the lead with a superb long-range effort to help the hosts lead 2-0 at the break.
Togo, who could have qualified with a win, threatened a comeback when Jonathan Ayite headed home in the 47th minute, but Ghana's stand-in captain Emmanuel Agyemang-Badu made sure of the win with just over 20 minutes remaining.
The home team started strongly and John Boye and Agyemang-Badu both saw headers go narrowly wide, before the pressure finally told in the 23rd minute when Waris nodded home Wakaso's superb cross from the right.
Wakaso then produced a moment of brilliance three minutes later with a left-footed thunderbolt from 35 yards that nestled in the top right corner.
Having seldom threatened in the first half, Togo needed a quick response and Ayite duly delivered when he planted a firm header home from eight yards two minutes after the break.
The match continued in end-to-end fashion, but Agyemang-Badu's deflected shot in the 69th minute took the game away from Togo and ensured Ghana of top spot.
Guinea took second in the group thanks to a 2-0 win over Uganda, also securing their spot in the tournament proper.