The Nicaraguan civil war ended early this moring as Sandinista National Liberation Front guerrillas took control of the capital and called for a cease-fire jointly with remaining leaders of the National Guard.

The arrival here of a guerrila-appointed government junta from its provicial capital in Leon was postponed, however, as guerrilla forces subdued resisting pockets of guardsmen and tried to contain jubilant crowds of Nicaraguans, many of whom ran through the streets with rifles and pistols. Strict admonitions against looting were issued.

Representatives of the new government said the junta would enter Managua Friday. Cabinet members and other officials flew in from Costa Rica tonight.

After a night of chaos during which the interim president fled to Guatemala and the National Guard battled the popular militia of teen-agers who support the guerrillas, a column of regular Sandinista troops entered the city at dawn and met practically no resistance.

Dressed in olive-drab uniforms and black berets, the heavily armed troops quickly established temporary headquarters in former president Anastasio Somoza's old "bunker" office and in the national telecommunications center.

At noon, a cease-fire call was issued over the national radio by Humberto Ortega, a Sandinista leader, and Col. Fulgencio Largaespada, who took over the National Guard early this morning after its entire general staff abandoned negotiations with the guerrillas and attempted to flee the country. He had previously headed the traffic police.

"The Sandinista National Liberation Front now controls all the national territory and has overthrown the Nicaraguan National Guard and ended the war," Largaespada said.

"To avoid more bloodshed and useless loss of innocent lives," he said, "all National Guard soldiers and officers are immediately cease firing on all fronts" and turn over their arms. The Sandinistas guaranteed the lives and physical integrity of all who comply with these orders, he said.

"This is not treason to anyone or anything," he said. "On the contrary, it means the surrender of all the National Guard for the well being of all our suffering people."

Although small groups of National Guard soldiers exchanged occasional fire with groups of guerrillas throughout the day, the call to surrender came after most guardsmen had long since stopped fighting. The few cities still in the hands of the National Guard mostly had surrendered their garrisons to the guerrillas during the night.

In Managua, 400 soldiers blocking the southern highway contacted the Red Cross and asked that the area be declared a neutral zone. In the city's central police headquarters, the National Guard released more than 600 prisoners before asking the Red Cross to take over.

Hundereds of National Guard soldiers, most in civilian dress and many with their families, entered designated Red Cross centers and churches throughout the day. The Sandinistas seemed unconcerned about the surrendered guardsmen and left their processing to Red Cross workers.

Although announcements about their fate are expected, perhaps even including trials for some, it was unclear whether the soldiers are to be considered prisoners of war or merely additions to the thousands of refugees already gathered in the city.

The National Guard Wednesday night placed its military hospitals under the protection of the Red Cross, whose officials said they spent the early morning hours driving truckloads of "grenades, explosives and ammunition" stored in the hospitals to a collection center established by the Sandinistas.

After 18 months of sporadic insurrection and nearly seven weeks of brutal civil war that left more than 10,000 dead, the end of the half-century rule of the Somoza family and the National Guard was almost anticlimactic.

For more than 12 hours through the night, Nicaragua was without any government at all.

Before fleeing last night, interim President Francisco Urcuyo - who took control when Somoza flew into exile Tuesday morning and then broke an agreement to hand power to the junta - had left in charge the newly appointed National Guard Director Col. Federico Mejia. Mejia began negotiations with the junta and the Sandinistas.

By midnight, however, heavy fighting had broken out in Managua and talks between Mejia and Sandinista leaders had reached a stalemate on Sandinista insistence on a surrender rather than a cease-fire in place.

At approximately 2 a.m., Mejia produced a list of National Guard demands, including retention of all property belonging to individual officers, in exchange for a surrender. The Sandinistas refused and communications were broken.

Just before dawn, Mejia, the National Guard general staff and most high-level officers remaining in Managua headed toward the airport. Reports that a plane evacuated them were unconfirmed.

Left with neither leaders nor orders, National Guard troops in the city quickly began deserting their posts, many discarding their guns and uniforms in the middle of the street. By the time the Sandinista column arrived, there were no organized troops left to fight.

The Sandinista column of about 300 left Leon, occupied by the guerrillas for more than a month, two weeks ago. The rebels had fought their way down a 54-mile highway to Managua, defeating National Guard troops and ambushing convoys in a half dozen towns along the way.

Several columns of Sandinista troops, totaling hundreds of men, entered Managua this evening. They had approached the capital along highways that were reportedly lined with people waving and singing to them.

At sunrise today, the rebels had taken over the government radio network and begun broadcasting calls for National Guard renegades to give up and turn themselves in. The radio repeatedly exhorted the public to remain calm, "to act with a mature attitude" and await further instructions as the junta government organized. Soldiers were sent out to collect the hundreds of weapons that had fallen into civilian hands.

Throughout the day, leaders of the Catholic Church, moderate opposition political groups and business associations broadcast congratulations and support to the Sandinistas.