A civilian airplane carrying four Central Intelligence Agency employes through a storm on a night-surveillance mission along El Salvador's border crashed into a mountainside near San Salvador early yesterday morning, killing the four Americans, administration and intelligence officials said.

The unarmed twin-engine turboprop was assisting the Salvadoran government by searching for anti-government guerrilla activity and for evidence that arms and ammunition are being shipped to the leftist guerrillas from Nicaragua, officials said.

Such flights originate at Palmerola Air Force Base in Honduras and occur frequently, intelligence sources said. They have been approved by congressional intelligence committees, according to Sen. Daniel Patrick Moynihan (D-N.Y.), vice chairman of the Senate Select Committee on Intelligence, who was briefed on the crash by CIA Director William J. Casey.

However, critics have charged that the flights violate the War Powers Resolution by involving U.S. forces in a combat situation. The administration has denied that, saying the flights simply provide intelligence to the Salvadoran government.

Moynihan said Casey assured him that the plane had not violated congressional prohibitions against operating inside Nicaragua. The CIA has provided financial and other aid to rebels trying to overthrow Nicaragua's leftist Sandinista government, but Congress has suspended the funding until at least March.

Intelligence sources said the plane was equipped with sophisticated night-photography equipment.

White House and State Department officials did not identify the victims but said their next of kin had been notified.

Casey also briefed Senate intelligence panel chairman Barry Goldwater (R-Ariz.), who disclosed the crash yesterday in Carefree, Ariz., where he spoke to the Arizona Newspaper Publishers Association.

Goldwater quoted Casey as saying a "CIA plane operating in Nicaragua crashed into a mountain killing some of our people, and it is going to be a rumble Sunday night," referring to the scheduled foreign-policy debate in Kansas City between President Reagan and Walter F. Mondale.

Goldwater said that he had received few details and that the plane "flew into the side of a mountain while chasing another plane believed to be carrying weapons to the enemy."

Administration officials said Goldwater was mistaken about the crash site.

White House spokesman Larry Speakes said that the crash occurred in the "early-morning hours" yesterday and that the plane was under contract to the U.S. and Salvadoran governments.

Another administration official said the plane's crew was working for the CIA.

"Its mission was to assist the government of El Salvador by warning of insurgents' offensive and identification of shipments of arms and ammunition by the government of Nicaragua to the guerrillas in El Salvador," Speakes said.

Washington Post correspondent Loren Jenkins quoted U.S. Embassy sources in San Salvador as reporting that the plane crashed on the Guazapa volcano, located about 15 miles north of San Salvador.

The volcano's slopes have long been a rebel stronghold. The Salvadoran Army has an observation point at the top normally reached only by helicopter.

Jenkins reported that thunder, lightning and rain raged throughout the night near the crash site, making flying extremely difficult.

Earlier this year, a knowledgeable U.S. military source said U.S. reconnaissance planes were flying regular missions over Nicaragua and occasionally drew ground fire. The Pentagon has denied that such flights were being made.

But the military source said an intense program of reconnaissance flights from Palmerola and from Howard Air Base in Panama puts about a half dozen U.S. planes over El Salvador and Honduras "all night, every night."

Salvadoran officials have said the U.S. reconnaissance flights have aided their Air Force's intensified bombing of suspected guerrilla positions.

The Associated Press reported from San Salvador that the bodies of four persons, said to be Americans and apparently the four who died in the crash, were taken to a funeral home yesterday afternoon.

The only other American official known to have died in connection with the Salvadoran civil war was Navy Lt. Cmdr. Albert A. Schaufelberger III, deputy commander of U.S. military advisers. He was shot and killed May 25, 1983, in San Salvador.