Nicaraguan President Anastasio Somoza tried and failed in a last-ditch effort to take his case directly to President Carter by telephone last weekend and wound up instead with a tough letter from Secretary of State Cyrus R. Vance demanding his exile, administration officials said yesterday.

Somoza's abortive call last Friday night to Carter, a man he had never met or even spoken to, touched off a train of events that led early yesterday to the Nicaraguan's resignation and flight to Florida.

The Carter administration, through State Department spokesman Hodding Carter, hailed "the end of the most prolonged remaining system of personal rule in the modern world" and expressed hope that Somoza's departure will end the Nicaraguan civil war and leat to reconstruction "in peace and freedom."

Late yesterday, the State Department expressed "grave concern" that the country's "transitional president," installed to hand over power to a guerilla-backed provisional government, seemed to be seeking to remain in office. The U.S. statement said any such attempt by Franciso Urcuyo Malianos would contradict understandings reached in advance with the Somoza government and with Urcuyo himself.

American officials said it was "plainly and clearly" agreed by both Somoza and Urcuyo in the past several days that there would be only "a short interim" in the transition. The agreement was made in conversations in Managua with U.S. Ambassador Lawrence Pezzullo, the officials said. While the length of the interim period was not precisely defined, the officials said they had anticiapted "a day or less."

The U.S. statement charged that Urcuyo's unexpected maneuvers could "deny the Nicaraguan people this historic opportunity for peace and reconciliation." It called on Urcuyo to meet "urgently" with representatives of the Sandinista-backed provisional government to work out the turnover of power.

Although officials did not expect the hitch to delay installation of the provisional government by more than a day or two, they feared it could complicate the already-delicate terms of the turnover and cause new fighting and bloodshed.

The State Department confirmed that the U.S. Navy amphibious assault ship Saipan is standing off the east coast in international waters in case of a need to evacuate Americans. Instead of its normal complement of more than 1,000 Marines, only 19 soldiers and six helicopters are aboard - "not a threat to any one," spokesman Carter said.

Somoza's arrival at Homestead Air Force Base near Miami yesterday morning - on a tourist-and business visa issued two weeks ago - was the end of over 40 years of family control of Nicaragua. It was also the dramatic high point of a bitter civil war and of at least nine months' effort by Washington to arrange a peaceful turnover of power.

As reconstructed by American officials, Somoza's downfall was certain from the time four weeks ago when he was isolated from other regimes in the hemisphere by vote of the Organization of American States, and was dealt a severe blow in American public opinion by the National Guard killing of ABC Television reported William Stewart.

Somoza told the United States early this month "in principle" that he was ready to resign, but held out for assurances which Washington sought to obtain from his opponents.

A five-point statement dispatched last Thursday to the OAS by the Costa Rica-based provisional junta promised "a peaceful and orderly transition," free elections and the absence of a spirit of vengeance or "indiscriminate reprisals."

These promises, cited hopefully by the State Department yesterday, were worked out in talks between the anti-Somoa junta and a special U.S. emissary, William Bowdler.

Following an apparently unsuccessful effort last Friday to win tangible support from the leaders of Guatemala, El Salvador and Honduras, Somoza attempted that evening to telephone Carter, who was at Camp David. The White House switchboard referred the call to the State Department, where it was taken by Deputy Secretary of State Warren Christopher.

According to Rep. John M. Murphy (D.N.Y.), a close Somoza friend and congressional ally, the Nicaraguan leader called Carter because "he wanted a talk with the final authority on his departure." The two presidents had never met because Somoza was ill when Latin American chiefs of state were invited to Washington in September 1977 for the signing of the Panama Canal treaties.

Christopher is reported to have told Somoza by telephone that a new statement of the U.S. position would be forwarded to him in Managua through diplomatic channels. The result was the Vance letter dispatched Saturday night, which was described by a State Department official as a blunt declaration that Somoz's departure was essential to ending the civil war.

The Vance letter to Somoza "blew him out of the water" and brought about his decision to leave, the official said.

By Monday morning, U.S. officials had learned from Somoza that he planned to leave Nicaragua Tuesday. The United States had previously agreed that he could take refuge in this country, so long as he abides by U.S. laws, especially the neutrality act which would forbid him from mounting an attempt from here to regain power.

U.S. officials have also agreed to give security protection to Somoza in his initial days here, spokesman Carter said yesterday.

The State Department statement read by Carter promised to increase emergency supplies and suggested that the United States would assist in the "immense tasks of national reconstruction." The prospect of U.S. aid as well as good relations with the United States is believed by American officials to be among the reasons why the Sandinista-backed junta has given assurances of democratic rights.

American officials were cautious in their statements about the likely course of a permanent successor government in Nicaragua. Some of the core groups of the Sandinista movement are avowedly Marxist, and the movement has close ties to Cuba.

"I'm being wary," said spokesman Carter at one point in briefing reporters. While he said he expects the "undertakings" of the provisional junta to be carried out, there was no claim that the United States has ironclad guarantees.

Some administration officials are known to fear that, despite pledges to the contrary, the new Nicaraguan regime will be troublesome leftist outfit on the Cuban model.

The State Department spokesman said "the difficulties are immense, the scars are very deep, the economic and political obstacles that have to be overcome are obvious." But he added that the United States believes that with support of all the various forces in and around Nicaragua committed to a democratic transition, such a result can be achieved. CAPTION: Picture, Somoza amid bodyguards in Miami Beach: "If it is a lifetime in exile, I will wipe floors if I must."