BONN, OCT. 8 -- West Germany, under U.S. pressure to support the western allies' naval presence in the Persian Gulf, announced today that it will send three warships to the Mediterranean Sea to take over duties of NATO members' ships that have been diverted to the Middle East.

The arrival of West Germany's task force, scheduled for Oct. 14, will mark the first time since the country was founded after World War II that its warships have been assigned to help patrol the Mediterranean.

The decision, announced by the Defense Ministry, represents a compromise between Bonn's reluctance to become entangled in the gulf and U.S. efforts to obtain the maximum possible allied support for its policy there, West German and U.S. officials said.

Five other European allies have joined the United States in sending warships to the gulf to help guarantee the free passage of tankers carrying much of the western industrialized world's oil.

West Germany, however, contends that its constitution bars it from deploying its armed forces outside NATO's area.

The decision also signified a modest victory within the Cabinet for Defense Minister Manfred Woerner. His arguments prevailed, despite Foreign Minister Hans-Dietrich Genscher's doubts over the wisdom of dispatching West German ships outside the waters that they normally patrol in the Baltic, North Sea and North Atlantic, government and diplomatic sources said.

Chancellor Helmut Kohl pledged at the June economic summit in Venice that West Germany would make ships available to take over responsibilities of U.S. vessels that had been sent to the gulf. But it was unclear until today whether West Germany would send its ships to the Mediterranean, or just take over U.S. duties in the North Sea and North Atlantic.

"This dispatch is a clear sign of West Germany's solidarity with our allies and a contribution to the relief of the allied partners who are maintaining freedom of shipping in the gulf region, which also is in West Germany's interest," a Defense Ministry statement said.

West Germany obtained 11.5 percent of its crude oil from gulf countries in the first eight months of this year, according to the Economics Ministry. Some of that oil left the region through pipelines rather than on tankers, however.

The 4,700-ton destroyer Moelders, the 3,800-ton frigate Niedersachsen and the 3,480-ton supply ship Freiburg will be in the Mediterranean under NATO's command from Oct. 14 until mid-December, and the tour could be extended, the Defense Ministry said.

West German ships have visited the Mediterranean previously for training exercises and diplomatic visits, but never had been given responsibility for helping NATO defend those waters.

The West German action pleased the U.S. government, although it fell short of what Washington would like.

U.S. officials said earlier this week that they hoped that Bonn would take the additional steps of sending ships to the gulf on diplomatic or "show-the-flag" visits, helping to pay the costs of European allies who had dispatched warships to the gulf and making public statements supporting U.S. policy in the region.

But West Germany is unlikely to take any other steps in the near future to help back its allies' gulf presence, according to two government sources and a western diplomat.

The European allies that have sent ships to the gulf are Britain, France, Italy, Belgium and the Netherlands.

West Germany was reluctant to make a high-profile gesture of support for the Americans in the gulf in part because of concern that it might alienate Iran, western diplomats said.

West Germany has maintained the closest relations with Iran of any of the major European allies, partly in the hope of obtaining Tehran's help in freeing a West German businessman held by pro-Iranian kidnapers in Beirut.

This attitude led Genscher, in particular, to express skepticism about the value of sending ships as far away as the Mediterranean, the diplomatic sources said.