For decades, it had been the traditional "Day of Brotherhood" celebrating the power and unity of Peru's hardiest democratic movement. But the tense scene that filled Lima's old downtown plazas on a humid night last month suggested something quite different and much more threatening.

There in the Plaza San Martin were the chanting, clapping thousands of the Peruvian Popular Revolutionary Alliance (APRA), the country's oldest political party. And over on Alfonso Ugarte Avenue was another massive crowd that also called itself APRA. In between were riot-geared policemen and tanks armed with water cannon--the force deemed necessary to keep the two factions of this historic party from tearing each other apart.

Meanwhile, in the packed squares and blocked streets, the blazing red banners and rhythmic shouts remained monotonously fixed on the party's one unifying symbol--a charismatic leader who has been dead more than two years.

The chaotic scene at the annual demonstration of APRA--once one of Latin America's most influential political movements--embodies the increasing political fragmentation that has become the greatest threat to Peru's newly reborn democracy.

Only 18 months after President Fernando Belaunde Terry took office following 12 years of military dictatorship, the fragile institutions of what is, in area, South America's largest working democratic republic are being tested by the bitter divisions that have destroyed one civilian government after another throughout Peruvian history.

Action in the Peruvian Congress frequently has been stalled in recent months by factional disputes that have engulfed not only APRA but also Belaunde's own political party, Popular Action. The Senate president has taken to publicly criticizing and occasionally obstructing his own party colleagues in the Cabinet.

And the bitter split of APRA into withering halves still dependent on a dead leader is threatening to erase a reformist fixture for more than 50 years of Peruvian politics, leaving the field to Belaunde's weakening conservatives and the equally divided but surging radical left.

Outside this uncertain party spectrum looms the perpetual force of the military, which has never hesitated to interrupt events with a coup when civilian politicians were perceived to be going astray. Twice in the last three weeks, Belaunde has felt compelled to publicly assure the country that the political turmoil was not leading to another coup despite charges by the government's defense minister that alienated politicians were already "knocking on the doors of the barracks."

There are, in fact, few signs that the armed forces are prepared to oust the still-popular Belaunde, whose last presidential term was abuptly ended by a coup in 1968. But the wide cracks in Peru's political base are being viewed with increasing concern by political leaders and analysts, who maintain that the high inflation and recession simultaneously plaguing an already poor country of 18 million will only make matters worse.

"The government functions and does not function, because Peru's parties are like monarchies--they have no conception of working majority and loyal opposition," said Julio Cotler, a leading political scientist here. "The minority has to completely respect the majority, or there is a fight--there is no such thing as consensus. And with the economic situation, every issue is going to make it worse."

At the center of the current political turmoil is APRA, which during its long history has been both the symbol of the upsurge of Peru's industrial and rural working masses and an inspiration to other pluralistic and reformist political movements in Latin America. Formed in 1924 in Mexico City while Peru was under the control of one of its military governments, APRA had all the ingredients of the broad populist movements that grew out of the industrialization of South America and the concentration in urban areas of the once-isolated, rural lower classes.

APRA's program stressed land reform and state-controlled development and its ideology was based on Marxism but staunchly opposed to international communism. The party took a nonaligned stance that stressed the "integration" of "Indo-America"--the great Andean and Central American populations of Indians and mixed races traditionally oppressed by a small economic elite.

Most of all, like Peronism in Argentina, APRA had a single, all-powerful, charismatic leader--Victor Raul Haya de la Torre, for half a century the most popular figure in Peru. Although denied the presidency by a series of bans on APRA and coups following election victories, Haya de la Torre for decades commanded a popular force without equal in Peru and he eventually inspired a series of reforms while denying the radical left its potential base of support.

"They had the strongest organization ever seen here," said Cotler of APRA. "In 24 hours, they could do anything--immobilize the government and shut everything down. And this was in a country without communications, without working telephones or decent roads. They did it all with flags and emblems and myths."

But in 1979 Haya de la Torre died at 84, leaving a gap that the movement so far has been unable to overcome.

"The problem is that Haya de la Torre was not just the head of the party, he was the pontiff--when he spoke, it was all over, it was decided," said Julve Ciriaco, an APRA delegate in Congress. "And below him, there were 20 or 30 people at the same level. So when he died, no one could determine who was going to lead."

Within months of the leader's death, APRA split into the two factions that last month held their separate demonstrations in Lima. The party then was beaten badly by Belaunde in the 1980 elections. The irony was that had Haya de la Torre lived, it is likely that he would have won the victory that for so long had been denied him.

Since the election loss, the divisions have grown more bitter, so much so that Armando Villanueva and Andres Townsend, who ran together as the party's presidential and vice-presidential candidates, now communicate from their polarized camps only through insults in the press.

The difference between the two men is as much personal as ideological. Townsend is a well-to-do, moderately conservative representative of Peru's middle classes, balding and distinguished, while Villanueva is a dark, harsh-voiced former organizer of APRA's "protection" squads who appeals to the party's working-class, left-of-center constituency.

The only way to reconcile such differences, says Townsend, "is to reorganize the party from the bottom up--make a clean sweep. But we can't agree to do that."

Without such a drastic reorganization--involving probably the retirement of Townsend, Villanueva and most of APRA's rigid hierarchy--the party, members say, probably will go the way of every other political party in Peru's modern history. So far, none have survived the loss of their founders.

The ruling Popular Action party faces the same prospect with the retirement of founder Belaunde, who will be unable to run for reelection in 1986.

Even some of APRA's old enemies are hoping that it will manage to perpetuate itself as the country's first stable political institution.

"The political history of Peru has been built around APRA," said one analyst. "They have been the only real organized, mass political movement. And so the failure of APRA is a real failure for Peru."