TOKYO — A powerful typhoon churned toward Japan on Thursday, grounding hundreds of flights, canceling upcoming matches in the Rugby World Cup and putting millions of residents in Tokyo squarely in the storm’s path.

In Tokyo, 1.5 million people live below sea level in eastern parts of the city and meteorologists warned that as many as 5 million people would have to be evacuated if levees in low-lying areas were to be overwhelmed by surging floodwaters.

The transportation cancellations were announced as cities, railways and airlines scrambled to prepare for the storm, which is expected to make landfall over the weekend.

In deciding to cancel the two rugby matches — between New Zealand and Italy in Toyota City and between England and France in Yokohama — the World Cup organizers said they had rushed to develop contingency plans.