European Community foreign ministers agreed today to halt arms sales to countries supporting terrorism but refused to endorse the U.S. campaign of condemnation and economic sanctions against Libya.

The agreement on a limited package of antiterrorist measures followed the failure last week of Deputy Secretary of State John C. Whitehead during a European tour to persuade U.S. allies to impose sanctions against Libya, which the United States blames for the attacks in the Rome and Vienna airports last month and other terrorist acts.

Hans van den Broek, the Dutch foreign minister who served as chairman of the meeting, said that while Libya was not named in the EC declaration, it was a "clear message" to governments supporting terrorism.

Van den Broek, referring to Libya, said it was his understanding that "no country wants to continue selling arms to that country," but he conceded that it was up to each member country to decide to whom the embargo on sales of arms and other military equipment will apply.

The arms embargo is not likely to have great effect because the important European arms manufacturing nations already ban sales to Libya, which receives most of its weapons from the Soviet Union.

The EC declaration said that "states that favor or protect terrorists cannot expect indulgence nor can they expect to have normal relations" with the community, but it made no mention of the U.S. call for economic sanctions against Libya. The United States had urged the European allies to cut oil imports and take other steps to put pressure on Libyan leader Col. Muammar Qaddafi

In one gesture to the United States, the foreign ministers agreed to "do everything within their power" to prevent businesses of their countries from undercutting measures taken by other countries "in reaction to terrorist attacks."

This measure apparently was taken in response to the U.S. request that European nations not fill in the gap in Libyan trade left by the U.S. boycott.

Earlier drafts of the declaration mentioned Libya, but community sources said that during the foreign ministers' meeting, Greece, Italy, France and Spain had opposed efforts by Britain and other member states to name Libya as a country supporting terrorism. The four countries traditionally have had strong relations with the Arab world.

Britain broke diplomatic relations with Qaddafi's government in 1984, following the killing of a policewoman, apparently by a Libyan gunman, outside Libya's diplomatic mission in London.

Italian Foreign Minister Giulio Andreotti said following the meeting that his country was not opposed in principle to naming Libya but that it was well known what country the declaration was referring to because of the U.S. campaign against Qaddafi.

European governments have told the United States that they believe economic sanctions do not work and have said in some instances that Washington has not provided conclusive evidence that Libya is behind the recent terrorist attacks.