Thousands of migrants poured into Austria and Germany on Saturday, as escalating tensions in Hungary forced the two countries to open their borders to one of the largest waves of displaced people since World War II.

Austrian officials said about 8,500 people had arrived at Vienna’s Westbahnhof train station. More than 7,000 continued their journey to Salzburg and Germany, while the rest would stay for the night in shelters and private accommodations.

The...