Reigning Africa Cup of Nations champions Senegal have been drawn against hosts Qatar in Group A, while Ghana will face Cristiano Ronaldo's Portugal at the 2022 World Cup.
The AFCON champions' group also consists of Netherlands and Ecuador in a difficult task for Senegal.
- 2022 World Cup finals bracket and fixtures
- 2022 World Cup draw: How it happened
Senegal booked their place into the tournament with a penalty shootout win over Mohamed Salah's Egypt in a repeat of the AFCON final.
Senegal's opening match at the World Cup will be against Netherlands on Nov. 21 before facing hosts Qatar on Nov. 25 and Ecuador on Nov. 29.
Ghana also face a difficult task in meeting Portugal, Uruguay and South Korea in Group H.
The Black Stars came close to clinching a semifinal berth at the 2010 World Cup, but lost to Uruguay in a penalty shootout after Luis Suarez was sent off in extra time for keeping the ball out of the goal with his hands and Asamoah Gyan missed the ensuing penalty.
Ghana FA president Kurt Okraku told BBC Sport Africa: "It is clear it will be revenge time."
Ghana kickoff their World Cup campaign against Portugal on Nov. 24 before facing South Korea on Nov. 28. They will face Uruguay in the last group match on Dec. 2.
"There are no easy groups, there are difficult ones," Portugal coach Fernando Santos said after the draw. "We have to be very careful."
Meanwhile, Tunisia have been drawn with reigning world champions France, Denmark and United Arab Emirates or Australia or Peru in Group D.
Elsewhere, Morocco face a tough group against Canada, Belgium and Croatia in Group F.
Cameroon also face a tough task after being drawn against Brazil, Switzerland and Serbia in Group G.
After the draw, France manager Didier Deschamps said: "It could have been worse, I don't know if it could have been better. I'm always calm, it's one step forward. It's a solemn moment. It allows us to plan ahead. We're feeling good about it."
No African team has made it past the quarterfinals of a World Cup. Cameroon reached the last eight in 1990 before Senegal matched the feat in 2002 and Ghana in 2010.
At the last World Cup in Russia 2018, there were no African representatives in the knockout rounds with Senegal eliminated by Japan via the fair play rule after finishing level on points and goals scored and conceded.
Elsewhere in Friday's draw, England were drawn in the same group as United States, IR Iran and the winner of Wales' playoff match against Ukraine or Scotland.
Information from Leonard Solms was included in this report.