Morocco defeated Ivory Coast 2-0 on Saturday night in Abidjan to qualifying for the 2018 World Cup in Russian Federation, the country's first appearance at the finals since 1998.
The more industrious Moroccans caused more problems for their hosts five minutes later when Benatia slotted home Mbark Boussoufa's corner into the next to send the home fans into anguish, as the Lions sealed a first World Cup ticket since 1998.
Peru, the world's 10th top-ranked country, and New Zealand, who stand at 122nd in the Federation Internationale de Football Association rankings, fought out a 0-0 draw in the Oceania/South America playoff first leg in Wellington.
Morocco's victory over the West African giants means three countries from North Africa made it to Russian Federation with Egypt and Tunisia having qualified already.
Gabon and Mali finished third and fourth in Group C and on six and four points respectively.
But after weathering an early storm, including a potential penalty call, Morocco scored two goals in the space of five minutes to put themselves on their way to the finals, where their last appearance was in France in 1998.
Morocco's win in Abidjan gave coach Herve Renard success over his former team and the country he led to the African Cup title in 2015.
Tempers spilled over as the two sides exchanged wild tackles and punches in the closing stages and Ivorian fans pelted the pitch with objects as their frustration boiled over.
A goalless stalemate at home to Libya was enough for the Eagles of Carthage to pip Congo DR to top spot in Group A, while Morocco recorded an impressive 2-0 victory away to Côte d'Ivoire.