BRUSSELS—Capping the number of refugees coming to the European Union would violate international law, a top EU official said Thursday after the German government floated the idea as part of its efforts to manage thousands of migrants arriving daily.

“We need to agree on fixed, generous contingents for taking in refugees,” German Interior Minister Thomas De Maizière told the lower house of the German parliament Thursday morning. These contingents, the German minister explained, would limit how many people are taken in.

But...