Morocco defeated Ivory coast 2-0 to top group C, with Nabil Dirar and Medhi Benati scoring two consecutive goals within five minutes during the first half.
Saturday's win takes the 'Atlas Lions,' who managed to clear the six-match group competition with a clean sheet, to international football's biggest competition for the first time since 1998.
Following the game in the Ivorian capital of Abidjan, Morocco coach Herve Renard received a congratulatory phone call from King Mohammed VI.
"I thank His Majesty for calling me. It's a huge honour," Renard said.
"He wanted to talk to us to pay tribute to everyone. Tonight we are proud of the Moroccan shirt, proud that the Moroccan flag returns to the World Cup. This is the fifth qualification so Morocco is not a small (football) country."
Tunisia, meanwhile, ended their World Cup qualification campaign with a draw after failing to put a goal past Libya in the Tunisian port city of Rades.
Despite dominating possession, Tunisia were frustrated by the Libyan defence to ensure the 0-0 finish.
The draw, however, proved just enough for the home team to qualify with 14 points and an unbeaten streak through the group campaign.
Just a point seperated Tunisia and group runners up Democratic Republic of Congo, who defeated Guinea 3-1 to finish the group with 13 points.
Tunisia last qualified for the World Cup in 2006, missing out on the 2010 games in South Africa and the 2014 competition in Brazil.