Helicopters flown by CIA employes clashed with Nicaraguan government troops twice this year while supporting CIA-trained Latin commandos who were under fire in small boats off the Nicaraguan coast, intelligence sources confirmed yesterday.

The Associated Press reported yesterday that exchanges of hostile fire occurred Jan. 6 around Potosi on the Gulf of Fonseca and March 7 near the southern port of San Juan del Sur.

Sources yesterday confirmed the two incidents and said the Central Intelligence Agency told congressional oversight committees that the actions were taken to defend Latin "assets" involved in a sea-based mission off the Nicaraguan coast.

In one case, a source said, a helicopter equipped with special rocket pods came from a "mother ship" operated by CIA employes that was directing the mining of Nicaraguan ports.

The mining, since halted, was intended to increase pressure on Nicaragua's leftist Sandinista government. Congress has since halted funding of the CIA operation in Nicaragua.

The CIA would not comment on the matter.

The Nicaraguan government, through Ambassador Carlos Tunermann, said yesterday that an exchange of gunfire had occurred on those dates and in those places between Nicaraguan forces on the ground and what the government considered enemy forces in helicopters.

Members of congressional intelligence committees were informed of the incidents by the CIA but apparently lodged no strong complaints.

"I think we understand what happened," one congressional official said yesterday.

The Associated Press report raised questions about whether the Jan. 6 incident was a defensive mission. Quoting one unidentified official, it said the incident occurred when an American-manned helicopter joined with a helicopter flown by Nicaraguan rebels to attack an arms-storage building in the northern port of Potosi.

The American-manned helicopter, the Associated Press reported, was flown by civilians under contract to the CIA and it drew antiaircraft fire from Nicaraguan ground forces. The attack had been ordered by a CIA official after earlier rebel efforts to destroy the building failed, the Associated Press said.

On March 7, rebel forces in a boat came under attack off the coast of San Juan del Sur and a CIA-operated helicopter intervened to provide covering fire, sources told The Post.

The Associated Press quoted an official as saying that, in both cases, the helicopters were supposed to "provide withering fire, so your forces could withdraw."

An official told the Associated Press that the helicopters were Hughes 500s, specially equipped with the rocket pods. The small Hughes 500s were used, the official said, because they could be easily maneuvered onto the limited deck space of the mother ship.

A similarly equipped Hughes 500, carrying two U.S. civilians and a Nicaraguan rebel, was shot down by Sandinista forces on Sept. 1 during an attack on a Nicaraguan military school at Santa Clara. All three men were killed.

The U.S. government denied any connection with the volunteers, but officials acknowledged that the helicopter was supplied by the CIA.