A Soviet freighter unloaded military equipment at the northwestern Nicaraguan port of Corinto today, but none of the small green boxes or other crates observed coming off the ship appeared to be large enough to contain parts of warplanes that U.S. officials have said may be aboard.

Meanwhile, sonic booms were heard in Corinto, here in the capital and at other locations at about 8:15 a.m., leading some Nicaraguans temporarily to believe explosions had taken place. The Foreign Ministry said the booms were caused by a U.S. SR71 spy plane. The ministry said it protested to the U.S. government.

While officially the Pentagon denied violation of Nicaraguan airspace, administration sources said that a low-flying SR71 may have accounted for the sonic booms, Washington Post staff writer Fred Hiatt reported in Washington. These officials said clouds over Corinto prevented useful photography.

One flight was scrubbed because of bad weather, and a second -- in which the plane was ordered to fly below the clouds -- failed to produce any helpful photographs because the pictures were taken at too sharp an angle, the officials said.

Nicaragua requested an emergency session of the U.N. Security Council to discuss the spy flight and other signs of a possible "U.S. attack," Foreign Minister Miguel D'Escoto announced tonight.

The government also announced that 20,000 youths who were supposed to pick coffee in coming months will be organized instead in militias to defend against a U.S. attack.

Earlier, government sources said that tension had eased following yesterday's "categorical" government denial that any warplanes were aboard the boat or were en route to Nicaragua. The Reagan administration has suggested that it would attack any advanced warplanes delivered here, and senior Nicaraguan officials had warned that a U.S. attack might be imminent following U.S. intimations Tuesday and Wednesday that warplanes were about to arrive.

"It's relatively more calm than yesterday," said a source close to Nicaraguan chief of state Daniel Ortega. The armed forces refrained from declaring a general alert after police were placed on alert yesterday.

No special security measures were in effect at Corinto, 92 miles northwest of here, and reporters were allowed to watch the unloading of the freighter Bakuriana from the port's gate, about 100 yards away. Union leader Carlos Garcia said the freighter was being unloaded by stevedores who normally unload ships in Corinto, and several stevedores said that they believed that the cargo was ammunition.

Some of the cargo unloaded today was placed in 17 military trucks that drove to Managua early this afternoon on what accompanying police said was a "special mission." Canvas or plastic sheets concealed the trucks' cargo, but there was no indication that any large airplane parts were being transported. Police prevented this reporter from following the convoy to its destination inside Managua.

U.S. officials say that satellite photographs indicated that a dozen crates carrying MiG21 warplanes may have been placed aboard the Bakuriana several weeks ago before it left a Black Sea port to come to Nicaragua.

While the boxes seen being unloaded today in Corinto were mostly about the size of orange crates, it was possible that the same Black Sea crates still were aboard the Bakuriana or had been unloaded during the night.

There was considerable confusion over the freighter's arrival yesterday and its cargo, highlighted by persistent but apparently inaccurate reports that a second Soviet freighter had docked this morning.

No U.S. warships were visible from Corinto this afternoon, a day after a U.S. frigate was seen 15 miles off the coast, apparently keeping an eye on the Soviet ship.

Nicaraguan officials declined to comment on what the Bakuriana contained, except to say that it did not contain warplanes and that its cargo was "purely defensive." The U.S. Embassy declined to comment on the record.

The lack of special security measures in Corinto contrasted with procedures used in the Caribbean port of El Bluff about two weeks ago when a Bulgarian freighter unloaded a military cargo there. That port was closed off to civilians, and military personnel unloaded the ship.

The Bulgarian ship delivered military helicopters, antiaircraft weapons and radar. The equipment was more sophisticated than anything received previously by Nicaragua, according to high-ranking diplomatic sources here.

U.S. officials in Washington said that the helicopters were Soviet-made MI24s, an assault helicopter gunship that provides the Nicaraguans with a significant new source of firepower against U.S.-backed antigovernment guerrillas.

Until now, the Nicaraguans' principal military helicopter has been the MI8, which is used principally for ferrying troops and cargo.

The United States repeatedly has protested over the expanding arsenal of Soviet Bloc weaponry here since the 1979 Sandinista revolution. Nicaragua has received more than 50 Soviet-made T55 battle tanks.