BERLIN — With record numbers of migrants pouring across the Hungarian border and rushing west, Germany, the country that had been the most welcoming in Europe, suddenly ordered temporary border restrictions on Sunday that cut off rail travel from Austria and instituted spot checks on cars.

The German move came just one day before European ministers were scheduled to meet in Brussels to discuss a plan to distribute tens of thousands of migrants across Europe, with many governments, particularly in Eastern Europe, bristling at being forced to accept more migrants than they wish to take.

The crisis is the latest, and perhaps thorniest, test of Europe’s willingness to work together to solve big problems amid rising populist, nationalist and Euro-skeptic movements across the Continent.

The restrictions put in place by Chancellor Angela Merkel’s government were seen as a strong sign — if not an outright message — to other European Union members that Germany was growing weary of shouldering so much of the burden in Europe’s largest humanitarian crisis in decades without more help and cooperation from other nations.