The three trailing candidates in Guatemala's presidential election Sunday were detained for an hour by armed riot police today as they sought to march on the presidential palace to present documents they said proved that the vote was fraudulent.

Candidates Mario Sandoval Alarcon, Alejandro Maldonado and Gustavo Anzueto were driven off in a police bus as blue-helmeted riot police, battle-dressed troops and secret police wielding automatic rifles fanned through the heart of the city. They fired into the air and tossed tear-gas canisters to clear the streets of more than a thousand supporters who defied a government ban on demonstrating.

The three were driven to police headquarters, where they presented their petition for annulment of the election. After about an hour at the headquarters, the three were released without charge and driven to their homes.

"This is stupid politically," said Sandoval. "By their actions they have only confirmed the fraud because the three of us together represented 80 percent of the electorate."

No final tally is available yet in the dragged-out count, although the latest total shows the official candidate, Gen. Angel Anibal Guevara, with 270,017 votes to 201,136 for Sandoval and 175,842 for Maldonaldo. Anzueto was out of the running.

The trailing candidates had called for today's demonstration, only to be told by the defense minister, Gen. Rene Mendoza, that it would be illegal since a permit was required.

Before the candidates were detained, secret police rushing through the square in front of the palace pistol-whipped a woman who argued with their order to get out of the square. Some civilians were pushed, others' hair pulled, and others knocked to the ground with rifle butts. At least five men, four of them in business suits, were arrested.

ABC-TV reporter Geraldo Rivera and his three-man camera crew were also roughed up and detained by secret police for trying to film the incidents. They were released several hours later, after U.S. Embassy officials interceded on their behalf.

Police also ripped away the cameras of an American photographer on assignment for Newsweek, Steve Clevenger, but they were returned by authorities this evening.

The three presidential candidates were detained by the police after they left a midtown hotel for the walk to present their documents alleging fraud to the presidential palace. They were accompanied by dozens of aides and a horde of foreign journalists.

The sidewalk procession was stopped in a side street by a phalanx of riot police with carbines. The square had been brutally cleared of hundreds of people, some peaceful demonstrators representing the opposition, others just office workers heading for home, unaware of the confrontation.

The candidates, were protesting the self-declared electoral victory of Gen. Guevara, the ex-defense minister supported by outgoing President Romeo Lucas Garcia. The trailing candidates argued in the street with the riot police for about half an hour, demanding the right to be allowed to present their case to Gen. Lucas in person.

The police finally told the three they would be allowed to go to the palace on their own without their aides. The police said, however, that they would have to board a police bus for the trip. After the candidates boarded the bus with policemen and waited in the street for about 10 minutes, an escort of police vehicles roared up, and the whole convoy sped off in the opposite direction of the presidential palace.

The spectacle of the losing candidates demanding the annulment of the elections because of alleged fraud in the countryside, followed by the government's harsh dispersal of demonstrators, served to put further in question the government's case that the elections Sunday had been "pure, free and clean." Guevara, for his part, said his "victory" represented a "new era" of democracy for Guatemala.

"We had hoped that the election Sunday would bring us peace," a woman university professor, who did not want her name to be used, said as she sought to flee the city center tonight by taxi. "It looks like things have only gotten worse."

The owner of a small coffee plantation, who also declined to have his name used, told reporters in front of the presidential palace that the action was just one more case of the "sort of repressiveness that has given Guatemala such a dirty name abroad."

The unlikely coming together of the presidential rivals, including Sandoval, an extreme rightist with his own private army, and Maldonaldo, a more moderate conservative supported by the middle-of-the-road Christian Democratic Party, was just one more wrinkle in the confusion.

Guatemala is beset by a wave of urban violence, much of it carried out by right-wing "death squads" that often have been supported by the government, and an increasingly active insurgency in the countryside by left-wing guerrillas.

Many in Guatemala, as well as the U.S. government, have held out the hope that the elections would undercut the violent extremists and lead to solution of severe economic and social troubles that Gen. Lucas is accused of magnifying with his hard-line policies.

Although the voting Sunday was carried out in an orderly fashion, the tabulation, recording and transmission of votes since have thrown the integrity of the election into doubt and brought the charges that once again the government has swung the election in favor of the candidate of its choice.

This afternoon, results from six of the country's 22 provincial capitals had yet to reach the capital, and the government had not computed how many of the nation's 2.3 million eligible voters had voted.

Gen. Mendoza said that the slowness of the vote count was the result of difficult conditions in some of the provinces where the guerrillas were active and where vote boxes had to be brought out by helicopter, an operation that had been hampered by heavy rain yesterday.