As the Iranian and Iraqi forces fought furious battles a few miles north of here, America's Persian Gulf fleet was steering clear of the conflict and one frigate, the Thomas C. Hart, sat at dockside here today undergoing a routine painting and overhaul.

Since the outbreak of hostilities Monday, the five-ship U.S. fleet was ordered to sit still to avoid any accusations that the United States was taking sides.

The command ship LaSalle, a former amphibious transport dock, the frigate Voge and the guided-missile destroyer Lawrence were all reported to be in "central" Persian Gulf. The fifth vessel, the destroyer Conolly, was reported to be currently in the Indian Ocean.

Sources here said the U.S. ships, which call this island Arab emirate home port, were not expected to approach the narrow Strait of Hormuz through which a major portion of oil exports to the United States, Western Europe and Japan is shipped daily. Yesterday, almost 80 vessels passed through the strait without problems despite the Iraqi-Iranian war.

But the United States has a substantial number of vessels in the proximity of the Persian Gulf that could be deployed should the vital sea lanes be threatened.

The 65,000-ton aircraft carrier Midway is currently at the Kenyan port of Mombassa, where it is packing up supples before returning to station in the northern Arabian sea, near the entrance to the Persian Gulf.

Already in the Arabian Sea are the aircraft carrier Eisenhower accompanied by seven warships including the nuclear-powered guided-missile cruisers South Carolina and Virginia.

The five-vessel Persian Gulf task force used to be the sole U.S. naval presence in the region stretching from the Persian Gulf to the Arabian Sea and the Indian Ocean. But the U.S. naval presence was significantly enlarged following the Soviet invasion of Afghanistan last December.

In addition to the Arabian Sea task force, there are seven U.S. cargo vessels stationed around the Indian Ocean island of Diego Garcia and carrying supplies and equipment for the projected Rapid-Development Forced of 200,000 troops. The force is currently being created for emergency duty in troubled spots of the region.

The United States has a total of 18 combat ships and 13 support ships in the area. The Soviet Union has 12 combat vessels and 17 support ships.

But the French deploy a 14-vessel task force in the Indian Ocean that could be used in case the West mounts an international effort to keep the Strait of Hormuz open.

The United States has negotiated agreements to use naval facilities in Kenya, Somalia and Oman to support the increased number of U.S. vessels in the region.

The U.S. Navy has maintained a full-fledged base here in Bahrain until 1975, when the emirate's government abrogated the agreement. Bahrain, however, allowed an American support unit to remain here to facilitate crew change, resupply and overhaul of the U.S. ships. Until last fall, only two Navy ships used Bahrain as their home port. Three additional ships were added last November.

American officials here are careful to keep the U.S. presence low key to avoid embarrassing the Bahrain government. Except for the commanding officer of the task force, no other naval personnel have families here.

The support unit is housed in one corner of a former British naval base that was vacated in 1971. But the ships berth at the public dock alongside commercial tugs and boats used for servicing offshore oil rigs.