Tension rose here yesterday as both government and opposition parties claimed victory in Tuesday's presidential election and armed troops repeatedly interrupted vote counting throughout the day.

The army interference in an election intended to be a showpiece of democracy has instead plunged into doubt the future of this Caribbean nation whose close ties with the United States give it a significance in Washington far beyond its size.

Whatever the real results of the balloting may have been, the confusing events of the past two days show that at least some progovernment forces are determined that the outcome should be favorable to them - even if that means blatantly falsifying vote tallies.TThe military fisrt occupied and shut down electoral offices Wednesday morning when it became apparent that opposition candidate Antonio Guzman was leading three-team president Joaquin Balaguer. The vote counting resumed yesterday.

The military occupation of the voting headquarters brought an immediate critical response from the United States, and President Carter was expected to make a public appeal for an honest vote tally.

In the past, the United States had sided with Balaguer and other conservatives to prevent leftists from taking power here. in 1965, U.S. Marines invaded the Dominican Republic when Washington claimed to fear that a Communist takeover was imminent.

The press secretary of Balaguer's party announced in a press conference yesterday that - according to the party's unofficial tally - the president had been elected to a fourth term by 180,000 votes.

Responding through diplomatic channels to what was described as a "very tough" inquiry Wednesday by Secretary of State Cyrus Vance, Balaguer said the counting had been resumed. He said it was not suspended because of a decision by the military but because of "rumours of a supposed coup d'etat propagated by antidemocratic sectors."

Opposition vice presidential candidate Jacobo Majluta said his Diminican Revolutionary Party had won "an overwhelming victory." He said the party would call a general strike if it is not declared victor in the election.

When the official count was halted Wednesday morning, barely 25 percent of the votes had been counted, but Guzman - a left-leaning moderate - was holding a strong lead.

The tallies by both political parties were apparently based on unofficial counts by poll watchers around the country. Both parties said they had counted between 80 and 90 percent of the vote.

Despite the continued confusion and obvious tension yesterday, Balaguer said in his message to Vance that the situation was "normal."

"My good name is involved in this process," Balaguer was quoted as saying, "and I will do my duty both as president and as a Dominican."

It remained unclear whether Balaguer was controlling the military or was out of touch with the situation outside his presidential palace. Opposition leader Majluta told reporters: "it is obvious that we have won an overwhelming victory. We have the support of the country's political, economic and religious forces. If there is a coup or electoral fraud, it will be answered by a general strike, followed by certain other measures so that any government based on fraud will be overthrown by the force of the people."

At the same time, Majluta was claiming a 3-1 victory for his party officials from Balaguer's reformist Party victory was theirs.

Party press secretary Hector Perez Reyes said the Electoral Commission had asked for the shutdown because of opposition interference. Electoral Commission President Manuel Joaquin Castillo said yesterday morning that he had nothing to do with the shutdown, was not informed in advance and did not know why it had occured.

Despite Balaguer's assurance that all was normal, the Electoral Commission was briefly closed down at least once again yesterday morning when armed troops entered the building on the outskirts of Santo Domingo.

The troops were accompanied, and apparently led by a civilian advisor to Balaguer.

Electoral officials accompanied by members of an international observer mission told the soldiers they would take no military orders, and the troops left. Among the international observers here are former president of Ecuador, Columbia and Guatemala.

Shortly after that incidents, soldiers turned up at the Federal District of Santo Domingo vote counting center, approximately three miles away, and cleared the building of workers. The soldiers, who said only that they were acting under "military orders," left without explanation after one hour and counting resumed.

Other reports reaching Santo Domingo and confirmed here by informed sources, said that municipal buildings in several other cities had been occupied by the military.

In Santiago, on the island's northern coast, electoral officials were reportedly detained at gunpoint late Wednesday night. Their families were threatened with death, and the officials were forced to sign statements verifying a government victory.

Informed sources described yesterday's military incidents as the work of a faction within the armed forces, and said that other groups in the military were determined to see the votes counted fairly. It was not certain whether the interfering faction was acting on government orders, or against them.

Informed observers seemed more apprehensive over the possibility of a coup than they had been on Wednesday, when the difficulties began.

One source in contact with the government said he expected a resolution of the situation "one way or the other" wiithin 48 hours.