Peter Mandelson, the EU trade commissioner, told the Saudi Minister of State that any Danish boycott would be a boycott of the European Union.
Peter Power, a EU spokesman, said on Monday: "He made it clear that if the Saudi government had encouraged the boycott, Commissioner Mandelson would regret having to take the issue to the WTO."
A Danish newspaper's publication of caricatures of Prophet Muhammad has led to tension between Denmark and some Muslim countries.
The Saudi minister told Mandelson the government had not encouraged the boycott.
Denmark told Riyadh it did not support the incitement of racial hatred, but could not condemn the free expression of the press.
The European Union executive agreed.
Johannes Laitenberger, EU Commission spokesman, said: "The exercise of these freedoms must be respected.
"It is the public debate on the pros and on the cons of the views expressed that is the right form of reaction in a democratic and pluralistic society, and pressure not to exercise these freedoms is unacceptable."
The Danish Foreign Ministry has warned Danes in the Middle East to take care.
Saudi Arabia recalled its ambassador to Denmark last week, and Libya has closed its embassy in the Danish capital.
Islamic tradition bars any depiction of the prophet, even respectful ones, out of concern that such images could lead to idolatry.
The EU Commission said on Monday that armed men demonstrated outside an EU technical facility in Gaza City to protest against the caricatures.
Various Gulf countries have
cleared the shelves of Arla goods
It said no one was injured and denied reports that the office had been occupied.
Consumers in many predominantly Muslim countries were boycotting Danish goods.
Denmark-based Arla Foods said the consumer boycott of its products in the Middle East was almost total.
Arla Foods' products have been removed from shop shelves in Saudi Arabia, Kuwait, Qatar, Bahrain and the United Arab Emirates, Europe's largest dairy group said.
The Middle East is Arla Foods' main market outside Europe.
It has $430 million in annual sales in the Middle East and about 1000 employees in the region.