Sadio Mane fired home the winning spot kick as Senegal beat Egypt 3-1 on penalties at the end of a tempestuous World Cup playoff second leg in Dakar on Tuesday to win a place at the finals in Qatar later this year.

Boulaye Dia scored in the fourth minute as Senegal won the second leg 1-0 for a 1-1 aggregate draw after extra time at the new Diamniadio Olympic Stadium, which was packed with a capacity 50,000 crowd hours before kickoff.

The nerve-filled shootout started with four misses, including from both captains - Kalidou Koulibaly and then Mohamed Salah - but Mane won the shootout, reprising his heroics from last month's Africa Cup of Nations final.

Egypt had netted a fourth-minute goal last Friday in the first leg in Cairo but that advantage was quickly eroded in the second leg.

Idrissa Gana Gueye's free kick was cleared in the wrong direction by Egypt defender Ahmed Fattouh, straight into the path of Dia, who needed two attempts to bundle it over from close range.

Senegal dominated the exchanges although the game was often interrupted by niggly fouls, gamesmanship and occasional pushing and shoving between the anxious players.

It did not help that both coaches -- Aliou Cisse for Senegal and Carlos Queiroz for Egypt -- spent much of the match barking at the officials from the touchline.

Senegal could have settled the tie in their favour inside the 90 minutes as Ismaila Sarr spurned a golden chance in the 82nd.

He was put free on goal by Mane’s defence-splitting pass but with goalkeeper Mohamed El Shennawy rushing out to close the angle, Sarr contrived to put the ball wide of the target.

Egypt’s best chance of the match fell to substitute Ahmed Zizo, who was served up an opportunity by Mohamed Salah’s cross but he put his header narrowly wide.

In extra time, Senegal could also have avoided the shootout but Pape Abou Cisse had two efforts well stopped by El Shennawy and Pape Gueye shot wide 13 minutes from the end of extra time.

In the shootout, the first four penalties were wasted before Sarr put Senegal ahead and Bamba Dieng made it 2-1 before Edouard Mendy saved from Mostafa Mohamed.

That gave Mane the opportunity to be a hero all over again with Senegal’s fifth kick, which he blasted straight down the middle to book their World Cup ticket.

"I was not worried about how they’ll manage the game mentally. We have guys who have won the Champions League," said winning coach Cisse.

Senegal edged Egypt on post-match penalties last month to win the Cup of Nations final in Cameroon. That match ended goalless with Senegal winning 4-2 on spotkicks with Mane converting the decisive penalty.

Senegal will now compete at a third World Cup after the reaching the quarter-finals in 2002 and competing in Russia four years ago.

(Writing by Mark Gleeson in Cape Town; Editing by Toby Davis)