The events of recent weeks, on top of five years of simmering and slowly rising hostility, have brought the United States and Libya close to a state of undeclared war.

It is a strange and ambiguous modern battle involving terrorists with dynamite and plastic bombs, naval manuevers in international waters and a contest for public opinion in the Arab world, Europe and the United States. With every passing event, however, the conflict seems to be coming closer to the threshold that would have been recognized as warfare in earlier times.

Libya's strident leader, Muammar Qaddafi, and his regime have been using the terminology of warfare for months. On Jan. 8, official Libyan news media described President Reagan's call for an international boycott of Libya as "tantamount politically to a declaration of war." On March 25, Qaddafi declared following a U.S.-Libyan clash in the Gulf of Sidra that "It is a time for confrontation -- for war."

What is new, according to administration officials, is that especially since March 25, Qaddafi has been backing his public rhetoric with private instructions to Libya's officials, agents and friends, especially in Western Europe and the Middle East. These instructions, some of which appear to have been intercepted by U.S. and allied intelligence, are reported to have included orders for attacks on U.S. targets in several European cities, including Berlin.

This appears to be among the reasons U.S. officials strongly suspected almost immediately that the bombing of a West Berlin discotheque early yesterday was Qaddafi's doing, and why that act far from Libya's shores was among the most serious steps yet up the ladder of U.S.-Libyan hostilities.

Based on intelligence information, West German and East German authorities as well as U.S. military and diplomatic headquarters in Berlin had been alerted to the danger of attacks before the powerful explosion at La Belle disco. If the Berlin bombing can be conclusively traced to Qaddafi by physical evidence or detective work, the United States can be expected to respond, possibly with actions that include military steps.

That in turn could lead to further acts of terrorism or other forms of warfare from Qaddafi, who has vowed to respond to U.S. actions and whose previous behavior contains a large element of "tit-for-tat" responsive activity.

U.S.-Libyan tension stretches back almost to Qaddafi's takeover in Libya in 1969, but it has become much more intense in the Reagan administration. According to the memoirs of former secretary of state Alexander M. Haig Jr., Libya was among the "urgent questions" on the agenda of Reagan's first National Security Council meeting on Jan. 21, 1981. It has reappeared on the NSC agenda many times since.

Reporting by Bob Woodward in The Washington Post has documented many of the plans and decisions of the administration's anti-Libya campaign, especially since last summer.

These included:

*High-level discussions within the U.S. government and with Egyptian officials of possible open military action against Libya.

*New economic and diplomatic sanctions ordered against Libya Jan. 7 in response to allegedly Libyan-connected terrorist attacks on the Rome and Vienna airports Dec. 27.

*The Gulf of Sidra naval and air exercises involving an extraordinary array of U.S. military forces two weeks ago.

In mid-1985, the Palestinian terrorist group headed by Abu Nidal is reported to have shifted its allegiance from Syria to Libya, giving Qaddafi a greater offensive paramilitary capability. Toward the end of last year, Qaddafi is reported to have authorized increased surveillance of U.S. diplomatic and other personnel in Western Europe and the Middle East. The pattern is said to have become increasingly evident following the Dec. 27 airport attacks. According to highly classified CIA reports cited last week in Newsweek magazine -- a disclosure that appalled some U.S. officials dealing with the problem -- "no fewer than 35" American targets have been under surveillance by Libyan agents in Europe and the Middle East. These targets were said to range from the offices of American firms to the headquarters in Italy of the U.S. 6th Fleet and the homes of its top officers.

Newsweek also reported that a message was sent March 26 from Tripoli to Libyan agents in Paris, Belgrade and Geneva ordering them to "prepare to carry out the plan." The magazine said similar messages went to Qaddafi agents in Berlin, Rome and Madrid. Mention of the "plan," which was not specified, may be the administration's basis for the charges yesterday of a Libyan "master plan" for violence against Americans in Europe and the Middle East.

The State Department said March 26 that "agents of the Libyan government have been conducting surveillance operations against a number of American installations and interests around the world. This could mean that Americans are targeted for attacks in the future."

State warned then that "there are a variety of assets available for a response to international terrorism and the Libyan threat in particular." Those assets are likely to be reviewed -- and some may be used -- in days ahead as the U.S.-Libyan confrontation, just short of war, escalates.