Tunisia edged out a wasteful Morocco 2-1 in their derby at the African Cup of Nations on Monday to join co-host Gabon with an opening-night win in Group C.

Saber Khalifa's faint touch on Khaled Korbi's 34th-minute free kick helped guide the ball home and send Tunisia into a surprise lead over its North African rival. Substitute Youssef Msakni made it 2-0 with a fine solo run and finish in the 76th.

Houssine Kharja scored a contentious late goal for Morocco to set up a nervous finish for the Tunisians at Stade de l'Amitie. Ahmed Kantari was clearly offside when he set up Morocco's captain.

Kharja nearly stole a point for Eric Gerets' disappointing team in stoppage time but he fired just over the crossbar.