The government on Saturday showed foreign journalists a plant the Reagan administration says is preparing to produce chemical weapons, but the visit was a drive-by view on a moonless night.

Thousands of civilians, including women and children, were camped nearby to "protect" the plant from a U.S. attack, Libyan officials said.Soldiers, tanks and surface-to-air missiles guarded the site 60 miles southwest of the capital of Tripoli. Children in the village of Rabta shook their fists and chanted anti-U.S. slogans at Western television cameras.

The mysterious factory has been at the center of a conflict between Libya and Washington that has threatened to escalate into military action. Fears of a U.S. attack were heightened Wednesday when U.S. warplanes shot down two Libyan fighters over the Mediterrean Sea.

The government had promised the three busloads of reporters a tour of "Pharma 150," which it says makes medicine.

However, officials refused to allow journalists out of the buses and into the building and did not drive close to the buildings until after nightfall. The buses came about 75 feet from the unlit plant buildings and did not stop.

A short distance away, a radar station operated high atop a barren ridge overlooking the highway and two surface-to-air missile sites.

Some tanks and an encampment of soldiers could be seen nearby.

One unidentified Libyan official said the radar, soldiers and air defense batteries were put in place after President Reagan said last month that the United States was considering military action to destroy the plant.

However, the radar installation was a permanent station on a concrete base, not a mobile unit.

Ali Ibrahim, the man identified as manager of the factory, insisted it was a pharmaceutical plant and said no foreign contractors were involved. The Reagan administration contends a West German company and other foreign firms helped build the complex. West Germany has denied the allegations.

The visit to the plant appeared designed to give reporters a chance to see the crowds that Libyan officials said were gathered along the road to "protect" the factory.

A small tent city had been set up about 21/2 miles from the plant, but it appeared too small to house the crowd of several thousand people in the area.

A large number of cars and vans were parked along the road along with at least a dozen empty buses.

"We're standing up to Reagan's call to attack," said Ahmir Mohammed, an Agriculture Ministry employee from Tripoli who said he was staying in the camp. "The children and women here are brave too," he said.