Heavily armed National Guard troops patrolled the streets and checked motorists at roadblocks here today in anticipation of violent outbreaks during an opposition demonstration scheduled for Wednesday.

The demonstration, including a mass and mile-long march, is to commemorate the first anniversary of the slaying here of newspaper publisher Pedro Joaquin Chamorro, a longime opponent of President Anastasio Somoza.

The probability that the march would result in violence appeared to lessen, however, when opposition politicians today applied for and were granted a government permit to demonstrate.

Similar commemorative masses are scheduled in cities throughout the country. The Broad Opposition Front coalition has also called a general nationwide strike for Wednesday afternoon.

Chamorro, whose family publishes Nicaragua's largest-circulation daily, the opposition La Prensa, was killed last Jan. 10 when gunmen forced his car off the road and riddled it with bullets as he was driving to work.

Informed observers here do not believe Somoza ordered the murder but Chamorro's fame as a Somoza opponent, and the fact that four men arrested for the crime have never come to trial, have made him something of a martyr for the anti-Somoza cause.

His death was a catalyst for rising discontent. When widespread violence broke out last February, clashes between civilians and the National Guard frequently took place at masses and demonstrations held in Chamorro's honor.

Sporadic clashes continued until September, when Sandinista Liberation Front guerrillas led a civil war against the National Guard that resulted in thousands of civilian deaths. Somoza's political opposition later participated in now-stalled U.S.-sponsored talks but pockets of both guerrilla and civilian fighting with the National Guard have erupted repeatedly.

In recent weeks, guerrilla attacks launched from hidden camps in Costa Rica, to the south, and Honduras, to the north, have been repelled.

In sparsely populated northern Nicaragua, the National Guard reportedly has conducted air attacks on guerrilla hideouts and has claimed to have killed at least 40 Sandinistas there in the past several days.

Foreign Minister Julio Quintana today absolved Honduras' military government of complicity in those guerrilla attacks from across its border, calling Honduras a "friendly" nation that is trying to rout the Sandinistas. Quintana accused Costa Rican President Rodrigo Carazo, however, of aiding the guerrillas.

Quintana said Nicaragua has tentatively decided against closing its border with Costa Rica for a third time following a decision last night by the Organization of American States to send observers to patrol the frontier.

No movement is reported in mediation talks between Somoza and the Broad Front opposition. The talks reached a stalemate two weeks ago when Somoza turned down a proposal by an international mediating team, including representative of the United States, Guatemala and the Dominican Republic, for an OAS-run referendum on his continuing in the presidency.

While the United States has publicly criticized Somoza for his intransigence and threatened sanctions, diplomatic sources here said to direct U.S. pressure on the government is expected at least until the end of January, in hopes that Somoza will change his mind.

The Broad Front now says it has withdrawn from the talks.

In an interview early this week, Somoza had charged the opposition with "trying to provoke the government" by calling Wednesday's demonstration, which has been heavily advertised in the opposition media, without government permission.

Somoza said illegal demonstrators would be "invited" by "loudspeakers and insinuations," to go home. Those who refused, he said, would be "persuaded" by "methods such as tear gas."

Any demonstrations held with a permit, he said, would not be impeded.

The Broad Front had refused to ask for such a permit both out of reluctance to allow the government to dictate its terms and the lack of a guarantor for the demonstration.

Under Nicaraguan law, sponsors must provide the signature of someone who agrees to pay for all property damages incurred before permission to demonstrate can be granted.

This afternoon, Rafael Cordova Rivas, a landowner and Broad Front leader, signed such a guarantee and the government quickly issued the necessary permit.

The opposition hopes the demonstrators will number in the tens of thousands, although there is no firm indication of how many will attend.