Thousands of Khmer Rouge civilians and soldiers, many of them weak from hunger and malaria, crossed into Thailand today in the largest exodus from Cambodia since June.

The refugees, whose numbers were estimated at 5,000 to 10,000, fled from a major Khmer Rouge stronghold at Phnom Malai, about 20 miles from the Thai border, after Vietnamese-backed troops of the Heng Samrin government shelled the border area.

The exodus of civilians and soldiers loyal to the ousted Pol Pot government coincided with warnings by refugee agencies that food shortages and expected resumption of fighting would force hundreds of thousands of Cambodians to flee the country.

Carrying blackened kettles, machetes, straw mats and small stocks or rice, the Khmers moved slowly, three abreast, along the border highway as astonished Thai villagers looked on.

Some small children had the spindly limbs and vacant stares of severe malnutrition. But disease, especially malaria, seemed to be the biggest problem for the group.

Adults and children were visibly feverish. Some could walk only with the help of friends.

"Can you get me some medicine?" one man asked. "I'm very cold."

A one-legged teen-ager hobbled along with the help of wooden crutches; a blind boy walked with one hand on the shoulder of another child.

A man, shivering with fever, collapsed under a tree as he reached the highway. A woman huddled beneath tall grass as she held a 15-day-old baby that seemed seriously ill.

Thai soldiers intercepted the ragged band as it wound its way through bushland and abandoned fields. The Khmers were directed to unused land about a half mile from the border where they sank to the ground with no shelter except some trees.

They would be allowed to stay only temporarily, Thai officers said. When they had regained their strength and fighting had subsided across the border, they would be sent back, according to the Thai officials.

The Thai government has indicated in the past; however, that third countries would be allowed to resettle newly arriving Cambodians -- if it was done without delay.

[In Washington, the Carter administration pledged an initial $7 million for an international relief effort to prevent starvation in Cambodia. It would include 10,000 tons of food commodities and $2 million in refugee relief funds.]

Last month, a senior Thai official said 60,000 Cambodians had gathered along the Thai border and could be expected to cross over. In following weeks tens of thousands more people appear to have moved west towards Thailand.

Additional pressures will be created if Vietnamese troops launch an expected major offensive to mop up remnants of the Khmer Rouge Army, driven from Phnom Penh in January. Diplomats estimate 170,000 Vietnamese troops are in Cambodia backing the Heng Samrin government.

Foreigh relief agencies have sent food supplies into Phnom Malai -- located about 20 miles from the Thai border town of Aranyaprathet -- and other places where people have gathered.

Squatting beneath a tree, Prak Sem, a middle-aged man whom the refugees identified as their leader, said that attacks by Vietnamese troops prompted the evacuation. Those who entered Thailand desperately needed food and medical aid, he said. More people would leave Cambodia from a point further south, he said. He claimed that none of the refugees were soliders but that, nonetheless, everyone would return to Cambodia as soon as possible to help drive out the vietnamese.

Nevertheless, a Thai solider rounding up the refugees said a number of Khmer Rouge soldiers had entered and an AK47 automatic rifle was confiscated by Thai troops, apparently from a man accompanying I-rak Sem. One 50-year-old man said that many of the young men among the refugees were soldiers who had hidden their weapons in the jungle.

The best-fed people in the group appear to be young men of military age, an indication that in Khmer Rouge camps soliders are given priority for the limited food stocks.

The man said he and his family arrived at the Phnom Malae stronghold, a series of thatch hut settlements, two months ago.

Food was short and disease rampant, he said. "We had no drugs for injections or pills. People died every day -- 10 in a single night." Four days ago his wife succumbed to fever, he added.

The Khmer Rouge kept many civilians in the camp against their will. No one was allowed out until this morning when "the organization," as the Khmer Rouge is called, ordered everyone to cross the stream that marks the border. The order came after a barrage of shells from Heng Samrin troops.

Those too sick to move were left behind, the man said. Some Khmer Rouge soldiers also strayed.

It remains unclear why a single shelling provoked such an exodus. A Thai officer said the Khmer Rouge control a strip of land 18 miles deep at Phnom Malai.

But recently they encountered a Heng Samrin patrol deep in their territory. The shelling, the first in Phnom Malai in many months, may have caused fear that a ground attack was coming.

The Thai military plans to bring food and water to the refugees Thursday. Officials from the U.S. Embassy and the United Nations have also arrived at the scene to survey the people's needs.