Mali finish third in ANC
Samassa put his team in front in the 21st minute with a diving header following a good pass from Adama Tamboura on the left. Man-of-the-match Keita made it 2-0 just after half-time.
Ghana wasted a chance to get back into the match when Mubarak Wakaso blazed his 58th-minute penalty high over the bar.
Ghana eventually pulled one back when Kwadwo Asamoah beat goalkeeper Soumbeyla Diakite with a long-ranger in the 82nd minute.
Then, as Ghana pushed forward in search of an equaliser, Mali caught them on the counter attack with Diarra scoring three minute into stoppage time.