German Foreign Minister Frank-Walter Steinmeier threatened legal action on Saturday against EU countries that refused to accept refugees under the bloc's quota programme.
Steinmeier said in an interview with German weekly Der Spiegel that "if it cannot be done otherwise, things will be resolved through the appropriate legal channels", adding that "Europe is a community of law".
The German minister spoke specifically of Slovakia and Hungary, which have both made their own threats of legal action against the controversial quota system.
Slovakia said last month that it would complain against the EU quota plan to distribute 160,000 refugees and migrants across the bloc.
Few migrants have entered Slovakia on their voyage to western Europe, and even fewer asylum seekers have chosen to stay. Under the EU's quota system, Bratislava is expected to take in just under 2,300 migrants.
"European solidarity is not a one-way street," Steinmeier said, adding that "those who refuse (to welcome refugees) must know what is at stake for them: open borders in Europe".
Europe's Schengen passport-free area is cherished as one of its most important achievements and the European Commission has repeatedly expressed concern that re-imposing border controls threatens its future.
EU leaders on Thursday set an end-of-June deadline to agree on a new border and coastguard force to slow the influx of migrants across the 28-nation bloc's porous external frontiers.
They also called for the rapid delivery of a promised three billion euros ($3.25 billion) in aid for refugees in Turkey in return for its help in stemming the flow.
Following a slew of emergency summits this year, they acknowledged they had been too slow to carry out a joint strategy to tackle Europe's worst refugee crisis since World War II.