Anti-Sandinista rebels based in the Honduran hills around this border village overran the neighboring Nicaraguan town of Porvenir last week and have defended their positions for eight days against heavy counterattack by Nicaraguan government forces.

Two Honduran soldiers and a number of rebel troops said here Monday that the advance on Porvenir and several other nearby Nicaraguan villages was made under cover of Honduran Army mortar and automatic weapons fire. The rebel drive is part of a major offensive begun early this month.

Nicaragua has formally protested that Honduras participated in the offensive. This was denied by both the government in Tegucigalpa and Honduran officers here.

Honduras also has denied that rebel troops are based on this side of the border, and U.S. officials have said that as many as two-thirds of the estimated 7,000 rebels operating in this region are based inside Nicaraguan territory. But during a day-long tour of the area, rebel troops and stores of weapons--with U.S. and Canadian, as well as some Arab, markings--were in ample evidence and in seemingly permanent positions.

The occupation of Porvenir marks the first time the U.S.-backed rebels have been known to hold a settlement inside Nicaragua for more than a few hours. The current offensive by the rebel Nicaraguan Democratic Force, composed of Nicaraguan exiles and led by soldiers of the former National Guard of Anastasio Somoza, is the third this year in the northern part of Nicaragua's Nueva Segovia province.

Political leaders of the rebel group, based in Tegucigalpa, have said their forces hope to take the provincial capital of Jalapa, about 10 miles south of here. The two previous offensives failed after several days as Sandinista forces drove the rebels into mountain redoubts in Nicaraguan territory, or back across the border into Honduras.

Covert U.S. aid to the rebels has been justified by the Reagan administration as necessary to help interdict shipments of arms from Nicaragua, through Honduras, to leftist guerrillas in El Salvador. The administration maintains that the arms shipments are orchestrated by Cuba, which it says has stationed thousands of military advisers in Nicaragua.

Porvenir, a farming settlement about half a mile from Los Trojes on the edge of a rich tobacco producing valley, was taken by a contingent of at least 300 rebels on June 7 after four days of heavy fighting, according to rebel troops.

Two young Honduran soldiers, from the 6th and 16th Battalions, described how Honduran troops converged on the border area between Cifuentes and Los Trojes, which are on either side of a triangle-shaped wedge of Nicaraguan territory jutting into Honduras. They said the troops provided two days of mortar and rifle cover for the rebels, who seized control of Porvenir four days later. Both soldiers denied Nicaraguan government charges that Honduran troops had crossed the border in the action.

A number of rebels also provided a similar story of Honduran Army support, claiming the Hondurans laid down a two-day barrage of mortars on Porvenir and the Nicaraguan town of Teotecacinte to cover the rebel advance.

Honduran Army commanders in both Los Trojes and Cifuentes, however, said the reports were Sandinista-inspired propaganda.

As seen from a vantage point of about 500 yards away Monday morning, Porvenir was under heavy Sandinista mortar fire, with smoke rising from a number of buildings. The rebels said they doubted they could hold the town much longer, and some speculated that the Sandinistas were trying to lure them into the open before attacking to retake the town.

In Managua Tuesday, the Nicaraguan government's news agency said the offensive had been crushed but said the fighting left nearly $5 million in agricultural damage, United Press International reported.

Occasional shots rang out from atop a hill on the Honduran side, where Honduran soldiers said their main base was located. "They're just harassing the Sandinista positions," said a soldier. He was leaning on a fence post marking the border while watching mortar rounds land on Porvenir. A group of rebels sat on the Nicaraguan side of the fence sharing sugar cane with the Hondurans.

Hundreds of empty ammunition boxes and packing tubes for mortar rounds littered the road. Markings on the boxes indicated most were U.S. and Canadian military issue.

Some small boxes for automatic rifle shells were marked in Arabic. Previously, ammunition with Arab markings--said to have come from rebel attacks and turned over to reporters by Sandinista officers--has been identified by western munitions experts as being of Egyptian origin.

Honduran and rebel soldiers in the area appeared on friendly and familiar terms with each other. On another hill, a half mile from the hilltop where the Honduran soldier spoke, dozens of ammunition crates, numerous automatic rifles and a 50-caliber machine gun sat on the front porch of a small house. A uniformed Nicaraguan exile sitting on the porch described the assortment of ammunition and various-sized mortar shells. A young Honduran Army soldier, a small walkie-talkie strapped to his belt, looked on. Neither of the men would give their names.

A green Toyota pickup truck, identical to those used by the Honduran Army patrols, was parked in front.

From atop a Honduran mountain overlooking Teotecacinte, which is inside Nicaragua, a Honduran Army patrol sat in a jeep mounted with a mortar. Automatic-rifle fire rang across the lush valley below in what Lt. Jose Manuel Padilla, 24, described as skirmishes between Sandinista troops and rebel forces trying to take the town.

Teotecacinte is about a mile from the rebel-occupied Porvenir (which means "future" in Spanish). Padilla said his forces are responsible for guarding the border, about 100 yards down the steep, pine-covered mountain. He said he fires on Sandinista positions only when fired upon. Shells from machine guns and small-caliber automatic rifles littered the area.

Three blue-uniformed, teen-aged rebels approached the patrol and chatted with the Honduran soldiers before moving on. They said they were on their way to Porvenir.

Los Trojes, a small Honduran town hugging the border, seemed calm. Residents said about six Sandinista mortar rounds fell in and around the town last Tuesday, but caused little or no damage. No casualties were reported.

Lt. Mario Santo Hernandez, in charge of the modest Los Trojes garrison, described the mortar incident as "unintentional," a product, he says, of Sandinista artillery overshooting rebel positions nearby. Local residents agreed, arguing that had the attack been intentional, the town would have suffered substantial damage.

Most residents of Los Trojes seemed to accept the substantial presence of the contras, often providing them food and shelter. However, a number of older residents complained that until last week, the rebels virtually occupied the town.

"It was anarchy here," said a frail old peasant sitting on a crate in a store. "They thought they ran the town." The woman running the store agreed. "The contras are trying to create scandal, telling everyone, 'The Sandinistas are coming!' but nothing is happening here. The day the war comes to Los Trojes, it will be all over Honduras," she said.

Another young peasant added, "When the contras were everywhere in town, there was no order. It was chaos." They said the Honduran Army eventually clamped down on them two weeks ago, and moved to restore its authority in the town.

Lt. Hernandez said his forces are under strict orders not to fire on the Sandinistas, "even if we see them." However, other Honduran soldiers said they have orders to return Sandinista fire, and do so almost on a daily basis.

Hernandez said the rebels were concentrated in Porvenir and the Sandinistas in Jalapa. Teotecacinte, he said, has been under constant fire for almost two weeks in an ongoing mortar and rifle duel between the contending forces.

Hernandez, belonging to the Honduran Army's 6th Battalion, said proudly that he participated in a joint Honduran and Salvadoran Army counterinsurgency sweep through Chalatenango province in El Salvador last November, which he described as "very successful."

The Salvadoran military strongly denied that Honduran troops crossed the joint border last year to rout leftist guerrillas that often use Honduran territory as a refuge, although the Salvadoran guerrilla Radio Venceremos denounced what it charged was a joint campaign involving as many as 1,000 Honduran troops.

There is little evident here to substantiate Sandinista charges of a large-scale Honduran military buildup along the border, although more than a half dozen soldiers said that three weeks ago the Honduran Army's 16th Battalion was brought in to bolster the 6th Battalion normally in charge of the border area.

Just off the main street of Los Trojes is a small white house used as the local army barracks, with about 25 cots. About 15 olive-clad soldiers congregated on the front porch, joking with visitors about the local rumors of "the impending Sandinista invasion."

About 10 miles to the west, the Cifuentes military headquarters had similar accommodations.

Lt. Savas Zavala said the road there "leads to Jalapa." Asked how many people travel the road, he laughed and replied, "Nobody.".

The Honduran government is widening and paving the road between Danli and Cifuentes, which one soldier said would significantly improve the mobility of Honduran troops in the border area.

The largest concentration of Honduran troops are based south of Danli, around Las Manos and Choluteca, their mobility impeded by the largely un-maintained mountain dirt roads leading to Cifuentes.