Thailand's Prime Minister Prem Tinsulanond, driven from Bangkok by a military coup, yesterday rallied forces loyal to him from a northeastern provinicial city and demanded the immediate surrender of the coup leaders now controlling the capital.

Prem claimed the support of the influential Thai royal family, which he said was under his protection in Korat, about 140 miles northeast of Bangkok. However, the exact circumstances of the royal family's presence and role there -- crucial to the eventual outcome -- were unclear.

Prem, a 60-year-old Army general, was earlier reported to have resigned when forces under Gen. Sant Chitpatima, the deputy Army commander, seized key installations in Bangkok. But yesterday Prem surfaced in the northeastern town of Korat, the headquarters of the 2d Army that he formerly commanded, and condemned the coup leaders as "traitors," United Press International reported from Bangkok.

Although Prem declined to say immediately whether his forces would move against Gen. Sant's troops, there were unconfirmed reports from the Thai capital that soldiers loyal to Prem were heading toward Bangkok from three directions. According to news services in Bangkok, there were no immediate reports of violence, however, and the capital remained calm.

Yesterday the two sides traded condemnations over radio and television, with each claiming the support of the majority of the Thai armed forces.

The Associated Press reported that troops loyal to Sant were guarding all government buildings with armored cars and machine guns and appeared firmly in control of Bangkok. But the agency quoted witnesses as saying at least 10 truckloads of troops supporting Prem reached the town of Saraburi, 55 miles northeast of the capital. In addition, AP said, unconfirmed reports said troops were moving on Bangkok from the north and south.

Prem claimed support of three of the commanders of Thailand's four military regions, but Sant declared that he had "20 times more" troops than Prem on his side.

Sant called Prem "a person of low morals and weak as a woman" and accused him of dragging the monarchy into politics, AP reported. Sant was also quoted as saying his administration would not alter Thailand's pro-American foreign policy.

Thailand has maintained close military relations with the United States since 1950 and remains its most important ally on the Southeast Asian mainland.

Faced with uncertainties over whose forces would prevail, State Department spokesman William Dyess initially would say only that a military coup was "under way" and that the situation was "fluid." Later, however, as reports indicated that the highly revered Thai monarchy may have thrown its support to Prem, State Department statements stressed the key role of the royal family.

"Our position is the king is the head of the state in Thailand, and we deal with whatever government is appointed by the king," Dyess said, according to UPI. Another State Department official said that Americans in Thailand were being urged to exercise caution and remain home in the evening.

The highly visible involvement of King Bhumibol Adulyadej in the confrontation and the potential for bloody clashes between the rival forces marked unusual departures from past military coups in Thailand. The queen and Crown Prince Vajiralongkorn broadcast appeals to Sant's troops to lay down their arms and expressed support for Prem, according to reports from Bangkok.

Thailand's constitutional monarchy, a largely ceremonial institution, has traditionally avoided an overt role in modern Thai politics, and most coups in recent years have transferred power smoothly and without resistance. There have been four successful military coups in the last decade.

"What generally happens is that people are very practical and nobody gets shot," a Pentagon official said. "But this time there's a chance of a confrontation. This coup is going to be a sort of forceps delivery if there's going to be a delivery at all. It's not coming out right the way Thai coups usually come out."

A Thai diplomatic source said the intervention of the king "sets a bad precedent for the future" and expressed fear that the king's position as the country's main unifying force would be damaged no matter which side prevailed. Even if Prem's forces put down the coup, the source said, the royal family's now close identification with Prem's fued-ridden and economically beleaguered government would be likely to ruin the king's prestige over the long term, possibly giving ammunition to the government's leftist guerrilla opponents.

Many Thai and foreign observers said any political and military advantage Gen. Sant's side might hold in Bangkok could be neutralized by King Bhumibol, who continues to enjoy a near divine status in some rural communities. Royal calls to lay down arms could have devastating effect on the coup generals' forces and morale.

It was not clear what led the American-born king to apparently cast his lot so closely with Prem. However, Prem is known to be a favorite in the royal household. Indeed, some Thai sources say the soft-spoken general owes his career to royal patronage.

Thailand has experienced repeated coups since absolute monarchy was abolished in 1932. But politically ambitious officers have traditionally moved only when their power within the military establishment was unchallengeabe. Those who were deposed normally fled the country or returned to private life without armed resistance.

Gen. Sant, a confidant of Prem as recently as last year, was deeply angered last fall when he was denied the most powerful job in the Thai military, commander-in-chief of the Army, a post held by Prem. Prem remained in the job after Sant's enemies within the Army began a whispering campaign against him.

The general's disquietude appears to have helped ally him with an influential group of young military officers known as the Young Turks, whose names appear prominently in the coup group's Revolutionary Committee. Some analysts see Sant as a mere figurehead for these men.

Despite this coup's departures from the norm, the old pattern -- that personalities outweigh ideology -- continues to hold force. Gen. Sant, among the last of Thailand's old generation of wealthy military leaders, is working with younger officers, many with combat experience along the Cambodian border but, to date, without outside business interests.