The Navy has reactivated a mothballed repair ship, the USS Sphinx, as an intelligence-collecting vessel for long-term deployment off the coast of Nicaragua, according to knowledgeable officials and information provided to Congress.

The Sphinx, newly equipped with sophisticated radars and communications gear, will eavesdrop on Nicaraguan communications and look for arms traffic in the Gulf of Fonseca, sources said. They said the $20 million outfitting indicates that the U.S. military intends to remain in the region a long time.

Navy officials noted, however, that the Sphinx could be useful in other situations. The U.S. fleet has not had a comparable intelligence ship since the Pueblo was captured by the North Koreans in 1968 and two similar ships were retired the next year, Navy officials said.

The Navy has maintained at least one frigate or destroyer in international waters near Nicaragua for most of the last two years, each one spending four to six weeks in the region listening to Nicaraguan communications. With no foreseeable end to that rotation, Navy officials wanted a ship equipped specifically for the mission to free more expensive warships for other duties.

Officially, the Sphinx will be designated as a repair ship intended to support smaller ships, such as hydrofoils. But Navy spokesman Lt. Cmdr. Bill Harlow, without discussing Nicaragua specifically, confirmed that the Sphinx also will have other duties that more expensive combatants have performed until now.

"While the primary mission of the ship is to provide tender and direct support services to small boats, the ship is also being equipped as an information-gathering platform," Harlow said. "While performing this latter duty, she will be able to perform a role now requiring much more costly warships, as a result freeing those ships for duties for which they were designed and equipped."

Harlow said the Sphinx, which had been stored at Bremerton, Wash., since 1971, will be recommissioned at the Puget Sound Naval Shipyard next month. It will be based at Little Creek, Va., where the Navy keeps a hydrofoil fleet.

The ship, first commissioned in 1944, is being refitted with communications relay equipment, air and surface search radars and "a limited landing area for small helicopters," Harlow said. He would not describe other intelligence gear that may be aboard.

Harlow also would not discuss where the ship and its crew of 11 officers and 180 enlisted men will be sent. "We do not discuss the details of operational matters, nor do we discuss specific ship schedules or movements," he said.

Harlow said the Sphinx will carry "limited self-defense armament," which another spokesman described as eight 40 mm guns and two .50-caliber machine guns.

The U.S. military has mounted a concerted but unsuccessful effort to intercept arms allegedly being smuggled from Nicaragua to El Salvador across the Gulf of Fonseca on Central America's Pacific coast. The Reagan administration has charged that leftist guerrillas in El Salvador are armed by Nicaragua, but has been unable to produce much evidence.

In an effort to catch or inhibit illicit small boat traffic, the Marines built a radar station and listening post on Tiger Island in the gulf. The Navy has kept a ship nearby and has conducted "arms-interdiction exercises" with the Honduran and Salvadoran navies.

U.S. officials have said that ships are useful as intelligence collectors because they do not require bases in foreign countries and because they can intercept signals without violating borders or airspace.

The USS Liberty, a listening and communications relay ship that was officially designated a "technical research ship," was damaged by Israeli torpedoes in 1967 and decommissioned the next year. The Pueblo, designated as an "environmental research ship," was captured by North Korea in 1968, and two ships of the same class -- the USS Palm Beach and the USS Banner -- were retired in 1969.