Citing fears of an "imminent invasion" by U.S.-backed forces, Nicaragua's Sandinista government today called for a special session of the United Nations Security Council to hear Nicaragua's case against Washington and "take the necessary measures required to contain the conflagration."

The urgent request in a formal letter from junta coordinator Daniel Ortega to U.N. Secretary General Javier Perez de Cuellar comes amid intense diplomatic maneuvering by the Sandinistas.

U.S. Charge d'affaires Roger Gamble, who, with the rest of the diplomatic corps, attended the announcement of this new move at the Foreign Ministry, said there was nothing new presented to suggest the United States has any such extreme plans and termed the language of the letter "offensive" and "unacceptable." He said the cause of negotiating reduction in tensions would be better served by quiet, bilateral discussions.

The Sandinistas' diplomatic initiative appears intended to head off any direct or covert actions against their government by the United States while shoring up their domestic defenses and international backing.

Top Sandinista officials met with Cuban President Fidel Castro on Wednesday in Havana, Nicaraguan Foreign Minister Miguel d'Escoto said at the Foreign Ministry this morning.

While generally declining to comment on the content of the talks with Castro, d'Escoto said the possibility of increasing the already considerable Cuba military assistance in Nicaragua in the event of an invasion "was not the object of the discussions." But he added, "I don't think truly responsible countries would stand idly by, just as we would not in the case of an invasion of El Salvador."

Earlier this week the Sandinistas made hurried trips to Panama, Costa Rica, and New York, where a senior official met with the foreign ministers of Canada and Mexico as well as U.S. Ambassador Jeane Kirkpatrick.

Nicaraguan junta member Sergio Ramirez returned from Mexico City this evening after a talk with Mexican President Jose Lopez Portillo about the problems of the area. Mexico maintains warm ties with the Sandinistas and is acting as a moderator between them and the increasingly hostile Reagan administration. Mexican Foreign Minister Jorge Castaneda is expected to visit here Monday after weekend talks with Castro in Cuba.

Although Managua remains calm, the diplomatic actions reflect a serious sense of alarm among Sandinista leaders, who say they fear that a planned guerrilla offensive in El Salvador next week could result in a massive U.S. response that would spill over into Nicaragua.

The reported, though unconfirmed, approval by President Reagan of a $19 million clandestine campaign to undermine the Sandinista government and a series of terrorist incidents already had the government on edge.

After attacks by anti-Sandinista commandos on two major bridges near the Honduran border Sunday, a state of emergency was declared suspending constitutional guarantees.

"We seem to be in some kind of a countdown," d'Escoto said after the press conference. "We feel certain" that the United States has "already taken a decision not only to hurt Nicaragua but to invade Nicaragua and this decision is in the process of being implemented."

D'Escoto said Nicaragua remains open to dialogue with Washington but, referring to a five-point proposal by Secretary of State Alexander M. Haig Jr. for reducing tensions, d'Escoto said, "Despite the fact that Secretary Haig has pretended to take the olive leaf in his hand, they have not closed the door on invasion."

The key stumbling block to any negotiations remains alleged Nicaraguan aid to the Salvadoran guerrillas, which the U.S. administration insists is vital both materially and logistically to those insurgents. The Nicaraguans insist that they are not now supplying material or logistical assistance to the Salvadorans and have challenged the Reagan administration to prove that they are.

Junta member Ramirez said at a press conference after his return from Mexico today that a cutoff of supplies to the Salvadoran guerrillas suggested in Haig's five-point proposal is "not viable" because "it is not true" that such an effort exists.

As tensions continue to rise, the Sandinistas are saying they have more concrete evidence of invasion plans by U.S.-backed forces than has been publicly reported.

Interior Minister Tomas Borge said yesterday that there are "serious indications" of such possibilities but declined to elaborate. Borge did say, however, that the $19 million said to be approved by Reagan for use in the covert undermining of the Sandinista government is not, according to the Sandinistas' intelligence, intended for distribution to "moderate opponents" of the regime but is "exclusively for the armed groups" interested in overthrowing the Sandinistas.

Businessmen opposed to the Sandinistas have denounced the reports of aid to moderate opponents as false and harmful to their nation as well as to their own position here.

Reuter added from Managua:

Nicaragua continued preparing its 2.5 million people for possible invasion by saying an air-raid shelter construction program was due to begin today.

Nicaragua's armed forces and militia, which Washington estimates total about 70,000, remained on full alert.

About 50 Americans living in Managua have made public a letter to the U.S. ambassador to Nicaragua asking him to help stop what they called an American destabilization campaign against the country.

The letter, released yesterday, called on the United States to aid Nicaragua instead of "arming its neighbors and threatening it with military actions."

The letter was signed by religious and social workers, academics and writers who live in Nicaragua.

Nicaragua's Sandinista leaders, who overthrew president Anastasio Somoza in 1979, have long been at odds with the Reagan administration.