Amid an anxious and uncertain popular mood, the leftist Sandinista government prepared today to celebrate the seventh anniversary Saturday of its rise to power with a strengthened resolve to survive against deepening hostility from the Reagan administration.

Crowds of olive-uniformed Sandinista followers will gather in Esteli, a northwestern city heralded in the lore of the 1979 revolution for rising up three times against the late U.S.-backed ruler Anastasio Somoza.

The celebration comes as the breach between the numerous Nicaraguans who enthusiastically back the Sandinista revolutionaries, and the many who have turned against them, is wider than it has been since 1979.

The nine-member Sandinista leadership opted to hold its birthday party in Esteli to defy the U.S.-financed counterrevolutionaries, known as contras, once active in the region but largely routed in the past year.

One top Sandinista leader, Carlos Nunez, said yesterday, "We want to show our troops are prepared to guarantee this event," as a display of the Sandinista forces' readiness to protect the government against the contras.

The move to Esteli also relieved the government of mobilizing a huge show of support at a time when Nicaragua is suffering shortages of basic goods and other severe economic hardships.

The streets of Esteli and Managua were heavily patrolled by police and soldiers today.

Underscoring the government's security concerns, Interior Minister Tomas Borge said in an interview late yesterday that a "small number" of Nicaraguans he described as "somewhat dangerous" were placed under house arrest in recent days because of suspected ties to the contras.

Borge also said there currently are 1,802 persons being held in Nicaraguan jails on charges linked to contra activity. Of those, 1,025 are awaiting trial.

Political prisoners also include 2,157 former members of Somoza's National Guard and political circle, Borge said. Independent human rights groups have charged that arrests on suspicion of antigovernment activity have increased by several hundred in the last three months. Since a state of emergency was declared last October, hundreds of Nicaraguans have also been detained for what police said would be a few days. They remain in jail, according to human rights activists.

Borge acknowledged in the interview that the number of prisoners charged but not tried is "too large" and blamed it on an antiquated and understaffed court system.

However, the interior minister, sometimes described as the most radical and hard-line of the top Sandinistas, called "nonnegotiable" the government's refusal to allow the International Committee of the Red Cross or other neutral agencies to visit the State Security police cells where political suspects are interrogated.

Denying charges made by some human rights groups that the government uses torture, Borge said, "we are forced to use an interrogation technique which takes some days."

The antigovernment Permanent Human Rights Commission in Managua has charged that as many as 2,000 prisoners are in State Security jail in the main facility in downtown Managua. Borge said that the normal number for that prison, where he himself served nine months in solitary confinement under the Somoza regime, is 10 to 20 prisoners.

No confirmation of the figures is available because the government has prohibited outside visits to the facility.

Borge, alternately jocular and stern, explained the government's siege mentality following the U.S. House of Representatives vote on June 25 to give $100 million in military and nonlethal aid to the contras: "We have no choice but to use the force of law and the repressive resources in our hands to confront the aggression against us by the United States," he said. But he denied the pace of arrests would accelerate in coming months.

Borge scoffed at rumors that a recent crackdown on political dissent following the House vote had provoked differences within the Sandinista party's unusual collective leadership.

Sandinista leaders have conducted regular, secret polls to monitor changes in public opinion here as the war with the contras escalates.

Borge confirmed accounts by several progovernment social scientists in Managua familiar with the polls. The studies show high frustration and discontent among a wide range of Nicaraguans because of the deteriorating economy.

But the government believes that the polls also indicate most Nicaraguans still view the Sandinistas as trying to defend their interests against U.S. hostility and a regional economic decline.