Patrice Nerveu's side nearly turned into spoilers for Gabon as they led twice in the game but a late comeback helped Gabon surge into the next round of the competition with a comprehensive win.
Read below to see how all the action unfolded.
4.30pmGood afternoon and welcome to the live commentary of the African Nations Championship clash between Mauritania and Gabon.
4.32pmThis is a crucial match for Gabon as they need a positive result to ensure their qualification for the quarter-finals of the competition, as they are currently second in Group D. A victory or a draw will guarantee their place in the next round and they will be hopeful of doing that against pointless Mauritania.
4.35pmJust look briefly at how these teams have put themselves in their situations. Gabon drew with Burundi in their opener but defeated the Democratic Republic of Congo, in their second clash. Meanwhile, Mauritania were beaten by Congo in their opener and again right at the death in their game with Burundi, as they conceded a last-minute goal.
4.39pmThe teams have been announced and we'll start with Mauritania.
4.40pmMARUITANIA STARTING XI: Toure, Fall, Niass, Ould Varajou, Lo, Gaye, Sidi El Hacen, Bagayoko, Deina Bah, Traore, Moulaye Ahmed
4.42pmMARUITANIA SUBS: Souleymane, Sakho, Wade, Sy, Coulibaly, Niass, Ould Voulany, Samb, Fall, Denna, Vall, Abdallah
4.45pmGABON STARTING XI: Moto, N'Guema, Mouele, Ondele, Avebe, Engonga, Mbingui, Kabi, Cousin, N'Zembi, Ntsitsigui
4.48pmGABON SUBS: Nzambi, Mounguengui, Nkoume-Kemba, Mayoungou, Djissikadie, Ndong, Ndong, Ness-Younga, Yacouya, Sokambi, Nze Mba, Loussoueke
4.52pmThe other game in Group D gets underway at the same time of our clash this afternoon/evening. But you can follow all the action here, if you so wish.
4.55pmThe players are making their way out onto the pitch and we should be underway shortly.
1 minKICKOFF! We're underway in the final group game of the tournament.
1 minCHANCE! A chance for Mauritania inside the first 30 seconds as the ball is pumped long into the box and Traore knocks the ball down into the path of Moulaye Ahmed down the left and he fires as goal from a tight angle, but Moto gets out to narrow the angle and make the save. What an opportunity.
2 minMauritania have the chance to keep the pressure on as the ball went out for a corner but the delivery from the set piece was poor and Gabon cleared their lines with ease.
4 minGOAL! Mauritania 1-0 Gabon (Moulaye Ahmed)
4 minMauritania take the lead and this time Moulaye Ahmed takes the chance on offers, as Bagayoko slides a through ball behind the Gabon defence and the striker beats the challenge of Mouele and gets to the edge of the box before firing an effort past Moto into the net. An excellent finish from the forward.
5 minThat goal really rocks the applecart in Group D, Gabon can't afford to lose this game and leave their fate for the quarter-finals in the hands of Burundi. They need a response.
7 minGOAL! Mauritania 1-1 Gabon (N'Zembi)
7 minThat lead didn't last long as Gabon fire their way back into the match and it's an error from Mauritania keeper Toure that hands them the equaliser, as Mouele raided down the right and crossed into the box, the keeper tried to claim the cross and missed the ball and N'Zembi nipped in at the backpost to head the ball home. Easy as you like for Gabon.
10 minCHANCE! Gabon should be ahead now as Engonga misses a great chance to put them ahead as he fires wide from close range after Ntsitsigui sped down the right and put a good low cross into the area for the run of the midfielder, but he spurned the chance under pressure from Fall.
12 minYELLOW CARD! We have our first booking of the game as Ould Varajou gets a yellow card for a poor challenge on the goalscorer N'Zembi.
14 minCHANCE! Toure makes up for his earlier error as he comes the rescue of his side when Ntsitsigui slipped a through ball for Cousin behind the Mauritania defence and as the striker turned and was through on goal, but was then tackled by the on-rushing keeper, who won the ball outside his box, allowing his defence to clear.
17 minAfter an all-action start to the game, it has calmed down in the last few minutes as Gabon have slowed the tempo slightly and are content at the moment just keeping possession in their own half.
20 minA baffling stoppage here by the referee. N'Zembi knocks the ball into the box from the left and Toure comes for the ball and doesn't get it after Ntsitsigui heads the ball upwards and Cousin tries to get on the rebound, Toure clambers over him and fails to grasp the ball, leaving an open goal for Engonga when he reaches the ball outside of the area, but the referee blows his whistle so a Mauritania player can receive treatment inside the area. Baffling, and even more confusing there's no argument from the Gabon players.
22 minAnyway, after that confusion it appears there was a foul in the area. I don't think there was but let's go with that. Play has resumed and Gabon try to come forward again but N'Zembi is offside as he tried to latch onto a ball from deep.
24 minKabi goes down on the left and Gabon win a free kick, around yards from goal down the sideline. Avembe lifts the cross into the box and Ondele powers a header at goal but his effort goes well over the bar. Gabon are dominating this game at the moment.
27 minThe game is going through peaks and troughs of excitement and then calm, Mauritania are trying to edge their way back into the game, and are throwing their weight around a bit with some heavy challenges. That seems to have disrupted Gabon's passing game in the last few minutes.
32 minMauritania press down the left and win a free kick as Moulaye Ahmed is brought down 30 yards from goal, on the angle. They may opt to cross this one into the area rather than shooting.
33 minSHOT! Sidi El Hacen decides to go for goal and he powers his shot through the ball but it lacks enough power to beat Moto, who claims the ball with ease.
34 minStraight from the free kick Gabon break downfield, the ball is hit long down the right for Ntsitsigui and he has Cousin in support down the middle, but his cross is too high for the striker and the chance is spurned as Mauritania can clear their lines.
36 minOFF THE POST! Cousin should put his side in the lead as collects Ntsitsigui's cross inside the box and takes a touch around Ould Varajou and fired his shot at goal when one-on-one with Toure, but is effort clattered off the post, when it seemed easier to score. What a miss from the striker.
39 minGabon try to keep the pressure as they win two corners down the right, the first is headed behind for another attempt but on the second Mbingui's cross goes to the back post, where it's met by Ondele but he can only head his effort over the bar, without testing Toure.
42 minDISALLOWED GOAL! Moulaye Ahmed thinks he has his second of the game as he is played in behind the Gabon defence and slots his effort past Moto, and he wheels away in celebration only for his strike to be ruled out for offside.
44 minMbingui does brilliantly down the left as he turns his man inside and out, before firing a long-range pass to N'Zembi just outside the penalty area and the striker is brought down as he tried to find Cousin and the referee awards a free kick.
45 minCousin stands over the ball 20 yards from goal and has the ball played back to him so he can blast it, but his effort is blocked by the wall and deflected away.
45 + 1 minCHANCE! Gabon gather that deflection as Kabi plays Ndong down the right and he whips a cross into the box, which is headed away but only as far as Avembe about 25 yards from goal and he tees up a volley for himself and he rifles the ball at goal, and his effort goes inches wide of the post. That was close.
45 + 2 minHALF-TIME: Mauritania 1-1 Gabon
5.54pmHalf time in this Group D clash and it's all square as N'Zembi cancelled out Moulaye Ahmed's fourth minute strike, while the forward was denied another goal by the offside flag just before the break to keep the scores level.
5.55pmGabon have had the better of the first half and should be further ahead but they weren't able to take any of the chance that were on offer, so their fate of reaching the quarter-finals of the competition is still up in the air.
5.59pmIn the other Group D clash it's 2-1 to Congo DR at the break and if the results stay the same, Congo DR and Gabon will advance.
6pmThe players are back out on the field and we should be underway shortly.
46 minWe're back underway in this Group D clash.
47 minCHANCE! Mauritania come within inches of taking the lead as the ball is knocked into Gaye's path on the edge of the area, he fakes the shot first time around to create space and then drills the ball with his right foot, but his effort goes just past the post.
49 minCHANCE! Gabon go close as well in an action-packed start to the half as Avebe knocks a ball in from the left and Ntsitsigui goes up with Toure as the keeper comes out to punch the ball, but the forward gets their first but he can't direct his effort on target and the chance is spurned.
52 minThe tempo of the half has slowed again like it did in the first after the early flurry. Gabon seem quite keen to dictate possession and are doing their utmost not to give Mauritania any chance to get sniff of the ball.
54 minToure's handling this evening has been terrible, it's displayed again as Mbingui lofts a cross into the box and the keeper is left with a simple claim, which he drops but luckily for him, there's no player in a white shirt to take advantage. Sloppy keeping.
57 minMauritania win a free kick just outside the penalty area as Sidi El Hacen raids forward and falls over his own feet but the referee is adamant he was tripped. Gabon aren't happy about the decision but luckily for the official Traore blasted the effort at the wall and the ball was cleared.
60 minCHANCE! Engonga blasts an effort from distance and his shot looks to be creeping into the net before Toure sticks out a hand and is able to turn the ball past the post, to deny the midfielder a certain goal. A brilliant save!
61 minMauritania are able to clear their lines from Mbingui's corner and that save from Toure looks even better now. What a moment in this game.
64 minGOAL! Mauritania 2-1 Gabon (Moulaye Ahmed)
64 minDisaster for Gabon as Mauritania re-take the lead as Ould Voulany slides a through ball in for Moulaye Ahmed and he puts him one-on-one with Moto, the keeper decides to gamble and tries to tackle the forward, but he knocks it past him and slots the ball into the empty net.
66 minAs it stands Gabon will be heading out of the competition now, they need to find a goal from somewhere desperately.
70 minGabon are pressing forward and their line as moved right onto the edge of the half-way line, they are trying their utmost to string something together here to try and find their equaliser.
74 minOFF THE BAR! Ntsitsigui raids inside the Mauritania box and takes a touch past the defender and bares down on goal, he only has Toure to beat and he powers a shot at goal but the keeper manages to get a fingertip to the ball and turn it onto the crossbar and somehow the defence clear the ball away.
75 minWas that the moment Gabon went out of the competition. They will hope not, there's still plenty of time left for them to get that goal they so desperately need.
79 minMauritania press forward and win a corner down the right. They work the ball short and Bagayoko tries to seal the game for them but his effort goes past the post and into the side-netting.
80 minCHANCE! Ntsitsigui and Ndong work the ball well down the right and the forward turns and makes a surge into the box, Engonga joins him and six yards from goal he tries to strike the ball but out of nowhere Ould Varajou makes the challenge to block the shot.
81 minCHANCE! From that clearance Gabon win the ball down the right and win a corner. From the cross from the set-piece Toure tries to punch the ball clear and the ball goes only as far a Avebe on the edge of the area, who drills a low shot at goal which goes inches wide of the post.
84 minGabon are putting the pressure on now as they win another corner this time down the left.
86 minGOAL! Mauritania 2-2 Gabon (Ondele)
86 minGABON GET THEIR EQUALISER! Avebe knocks the ball into the box from the corner and the delivery is perfect and Ondele meets the ball at the back post and powers a header past several players on the line and Toure and into the net. Gabon will go through if they can hold out.
89 minOFF THE BAR! Ntsitsigui is denied yet again by the crossbar, he gets played in behind the Mauritania defence with a lovely back-heeled pass from Engonga and he cuts across the box and hits the ball left-footed and he beats the hand of Toure but the ball clatters off the bar and bounces clear.
90 minThere will be five minutes of added time.
90 + 1 minGOAL! Mauritania 2-3 Gabon (Sokambi)
90 + 1 minGabon guarantee their place in the quarter-finals of the competition thanks to an error from Toure as Sokambi takes the ball down the left and, he sees the keeper off his line and decides to try an effort at goal, the keeper gets his hand to the lofted shot but he can't keep it out and it finds the net.
90 + 3 minPENALTY TO GABON!
90 + 3 minGabon win a penalty as Mbingui is felled in the penalty area and Sokambi will step up to take the spot kick.
90 + 4 minGOAL! Mauritania 2-4 Gabon (Sokambi)
90 + 4 minSokambi steps up and fires the ball into the bottom corner of the net, sending Toure the wrong way and that seals his side's place in the quarter-finals of the competition.
90 + 5 minFULL-TIME: Mauritania 2-4 Gabon
6.57pmGabon secure their place in the quarter-finals of the competition as they haul themselves back from a 2-1 deficit to beat Mauritania 4-2 in their Group D clash thanks to a late goal from Ondele and a brace from Sokambi. They were the better side throughout the game but were having problems in front of goal, as they hit the woodwork three times and Toure made a couple of good saves but they weren't to be denied.
7pmMauritania end the tournament without taking a single point from their three games. They played well in bursts but just couldn't keep the goals out as they conceded seven in their last two matches. They were nearly spoilers here but Gabon weren't to be stopped on this occasion.
7.03pmThanks for joining our commentary this evening. We'll be back later in the week with all the action from the quarter-finals. Until then, goodbye.