Burkina Faso reached their first Africa Cup of Nations final by beating Ghana on penalties in a dramatic and controversial semi-final in Nelspruit.
The Burkinabe were denied spot-kicks in normal time and in extra-time, when they also had a goal ruled out, and saw Jonathan Pitroipa harshly sent off.
Mubarak Wakaso put Ghana ahead in normal time with a debatable spot-kick, before Aristide Bance equalised.
Burkina Faso won the penalty shoot-out 3-2 to set up a meeting with Nigeria.
That Pitroipa - outstanding throughout the tournament - will not be a part of that showpiece match in Johannesburg will take some of the joy out of the victors' celebrations.
Referee Slim Jedidi showed the winger a second yellow card for diving in extra-time when it looked liked a clear foul on the player, having earlier twice turned down plausible penalty claims from the Burkinabe.
Justice appeared to have been done when Emmanuel Agyemang Badu missed Ghana's fifth spot-kick in the shoot-out and Burkina Faso players began celebrating their historic achievement.
One step beyond
Burkina Faso's pervious best performance was reaching the semi-finals in 1998 when they hosted the tournament
Having played on the dreadful Mbombela Stadium pitch in all four of their previous games, it was perhaps no surprise that the Burkinabe settled more quickly than Ghana.
They should have won a penalty for what looked a blatant push by John Boye on Pitroipa. But the referee was not impressed, and then ruled that Mady Panandetiguiri had fouled Christian Atsu as the pair rose to battle to get their head on a free-kick into the box and awarded Ghana a penalty, which Wakaso converted.
It was a turnaround in fortune for the Black Stars, who had lost defender John Pantsil to injury within the first 10 minutes.
Skipper Asamoah Gyan then had a chance to put Ghana firmly in control when he beat the offside trap to bear down on Daouda Diakite but the Burkinabe keeper closed down the angle well to make a save.
But Burkina Faso, who have been resilient throughout the tournament, responded well and Prejuce Nakoulma had a good chance to hit back when he latched on to a long ball over the top, but blazed over the bar.
The end of the half belonged to Ghana and they could have had another penalty in the opening period when Paul Koulibaly tangled with Badu.
And the Black Stars missed another good chance to double their lead in open play when substitute Solomon Asante - on for Pantsil - poked over after great work by Kwadwo Asamoah.
The Burkinabe looked in determined mood after the break and soon saw Bance's header brilliantly clawed out of the top corner by Dauda.
Five minutes later, Gyan had an excellent chance to give Ghana some breathing space but struck the foot of the right post from 10 yards out.
A Twitter campaign has already begun to get Cas to rescind Jonathan Pitroipa's red card
And the Black Stars skipper was soon made to pay for that miss when Bance, one of three changes to the Burkinabe starting line-up, put his side level, side-footing home after Badu had been robbed in midfield.
Gyan had a chance to atone for his miss when he rose to meet a right-wing cross but his header went narrowly wide. To add injury to his disappointment, Gyan was then kicked by Paul Koulibaly while on the floor, with the Burkinabe man lucky to be booked rather than sent off.
With neither side able to make the breakthrough, the game went into extra-time and there were chances galore for both teams.
Ghana substitute Harrison Afful brought a good save from Diakite before Burkina Faso's Bakary Kone headed over from close range and then Bance beat two men and cut inside but lashed his shot over the bar.
Soon after came perhaps the most controversial call of the game. Nakoulma beat Asamoah to a throughball and poked the ball past Fatau Dauda but the referee ruled the goal out for a foul that was difficult to detect.
In the second period of extra-time the Burkinabe came close again when Bance's fierce drives somehow cleared off the line by Afful.
As extra-time ran down, Pitroipa was dismissed when he should have won a penalty, but more penalties were to come as the game came down to a shoot-out.
Pan Pierre Koulibaly was the only Burkina Faso player to miss as they ran out winners, with Badu the unfortunate man to miss for Ghana, who now contest the third-place play-off with Mali.
Burkina Faso coach Paul Put:
"The refereeing decisions were scandalous.
"We've lost Jonathan Pitroipa now for the final. He's very important to us, but we are 23 players and it's up to the technical staff to devise tactics to beat Nigeria without him and [the injured] Alain Traore."
Burkina Faso captain Charles Kabore:
"The referee is human, all humans make mistakes, but he happened to make too many tonight.
"But we're not going to dwell on that. We've qualified."
Ghana captain Asamoah Gyan:
"We came here to win [but] the better side won on penalties.
"We're all really sad now. That's normal. We're down, but we have to psyche ourselves up now for the third place play-off with Mali."
- 01 Diakite
- 04 Kone
- 08 P Koulibaly Booked
- 12 Panandetiguiri
- 05 Koffi (H Traore - 90' )
- 06 Kone
- 07 Rouamba
- 11 Pitroipa Dismissed after an earlier booking
- 18 Kabore
- 22 Nakoulma
- 15 Bance
- 16 Soulama
- 23 Sanou
- 03 H Traore
- 10 Al Traore
- 13 Ouattara
- 14 Balima
- 17 Rabo
- 20 Sanou
- 21 Traore
- 02 Dah
- 09 Dagano
- 19 PP Koulibaly
- 16 Dauda
- 04 Pantsil (Asante - 10' )
- 15 Vorsah
- 21 Boye
- 23 Afful
- 07 Atsu
- 08 Agyemang
- 11 Rabiu Booked (D Boateng - 47' Booked )
- 20 Asamoah
- 22 Wakaso (Clottey - 104' )
- 03 Gyan
- 01 Adjei
- 12 Larsen
- 02 R Boateng
- 05 Awal
- 13 Akaminko
- 19 Mensah
- 06 Annan
- 09 D Boateng
- 10 Adomah
- 14 Asante
- 17 Clottey
- 18 Boakye
Ref: Slim Jedidi