Zambia left it until late on Saturday at home to book their place at the Total African Nations Championship (CHAN) Kenya 2018 after beating South Africa 2-0 at the Levy Mwanawasa Stadium in Ndola.
A brace from Justin Shonga in the last ten minutes of the second half sealed Chipolopolo's passage to their third finals in the history of the competition designed exclusively for footballers playing in their domestic leagues, 4-2 win on aggregate.
Zambia dominated the first half but South Africa's Bonginkosi Ntuli gave them an early scare in the fourth minute, and goalkeeper Toaster Nsabata proved equal with a superb save.
Three minutes later, the host came close to taking the lead when Augustine Mulenga saw his teasing shot come off the post.
Mulenga, who had been in the midst of most of Zambia's forays, then limped off in the 44th minute with an injury, and had to be replaced by John Chingandu.
Prior to that, the Chipolopolo saw chances go begging from Alex Ngonga in the 24th minute and Shonga three minutes later.
Bafana Bafana attacked sporadically and Roscoe Pietersen saw his 28th minute header cleared off the line whilst Ntuli fired wide from close range on the half-hour mark.
The South Africans improved after the break with Ntuli again denied by Nsabata in the 49th minute while Dumisani Zuma saw his seemingly goal-bound effort land on the roof of the Zambians net.
Shonga then broke Bafana's hearts with two quick goals when he fired in the first in the 80th minute before adding the second three minutes later from close range.
This is Zambia's second straight CHAN finals after reaching the quarterfinals in 2016 in Rwanda. The Chipolopolo finished third at the inaugural edition in 2009 in Cote d'Ivoire.
The final tournament will take place from 12 January to 4 February 2018 in Kenya.
19.08.2017 Kinshasa DR Congo 1-1 Congo (0-0)
19.08.2017 Yaounde Cameroon vs Sao Tome (2-0)
19.08.2017 Kigali Rwanda 2-0 Uganda (0-3)
19.08.2017 El Obeid Sudan vs Ethiopia (1-1)
18.08.2017 Sfax Libya 1-1 Algeria (2-1)
18.08.2017 Rabat Morocco 3-1 Egypt (1-1)
19.08.2017 Ndola Zambia 2-0 South Africa (2-2)
19.08.2017 Luanda Angola vs Madagascar (0-0)
20.08.2017 Windhoek Namibia vs Comoros (1-2)
West A Zone
19.08.2017 Bamako Mali vs Mauritania (2-2)
22.08.2017 Conakry Guinea vs Senegal (1-3)
West B Zone
19.08.2017 Kano Nigeria vs Benin (0-1)
19.08.2017 Abidjan Cote d'Ivoire vs Niger (1-2)
20.08.2017 Kumasi Ghana vs Burkina Faso (2-2)