Vietnamese troops today overran the key Ampil base of Cambodia's main anticommunist resistance group after more than 24 hours of shelling and ground fighting that forced the camp's guerrilla defenders to flee across the Thai border.

A number of Vietnamese artillery rounds landed on Thai territory, and Thai gunners fired back across the border. About 60 miles north in Thailand's Buriram province, a Thai Air Force A37 light strike aircraft was shot down this morning while supporting ground troops in an area where a Thai patrol clashed this past weekend with Vietnamese intruders, Thai authorities said.

After having been driven from their Ampil camp, hundreds of guerrillas of the Khmer People's National Liberation Front were regrouping along the border near here today for what their leaders said would be a series of counterattacks aimed at recapturing their most important base, site of the front's military headquarters. But it was apparent that the Vietnamese onslaught, which went more quickly and met less resistance than expected, had already dealt the front a severe military and political blow.

Sporadic fighting continued in the camp today amid what appeared to be a systematic Vietnamese effort to destroy its main installations. But by nightfall, the remaining guerrilla defenders had withdrawn, Thai military sources said.

As Vietnamese artillery and mortar rounds crashed near the main western entrance to the Ampil camp a few hundred yards from a Thai antitank ditch, tank and automatic weapons fire could be heard inside the sprawling settlement that formerly housed about 23,000 Cambodian civilians and more than 5,000 Khmer front guerrillas.

About 400 yards from a vantage point at the antitank ditch, one of Ampil's bamboo and thatch structures suddenly went up in flames, apparently torched by the invaders. One reporter who approached to photograph the scene was driven back by rifle fire.

Thailand's 1st Army Region commander, Lt. Gen. Picht Kullavanich, told reporters at the border today that although the Vietnamese had largely overrun Ampil, the guerrillas still held about a quarter of the camp. But Khmer front leaders told western diplomats that only about a tenth of the camp was still under guerrilla control.

Later, a Khmer front spokesman said the remaining guerrilla defenders had been ordered to withdraw to avoid further casualties and regroup the front's forces.

As artillery fire echoed across the border behind them, hundreds of Khmer front guerrillas dressed in camouflage uniforms and carrying Chinese-supplied weapons could be seen waiting in ditches beside a dusty Thai border road for trucks bearing old Cambodian license plates to take them to regrouping points along the frontier.

Thai military sources said fewer than 20 Khmer front guerrillas were killed and about 50 wounded in the Vietnamese assault that began yesterday, the sixth anniversary of Vietnam's capture of the Cambodian capital, Phnom Penh.

The Vietnamese invasion of Cambodia, launched in December 1978, quickly ousted the Communist Khmer Rouge government, which had ruled the country brutally for nearly four years. Since the invasion, the Khmer Rouge, the Khmer People's National Liberation Front and a smaller noncommunist faction led by Prince Norodom Sihanouk have formed a coalition despite serious differences. The coalition has U.N. recognition as Cambodia's legal government.

Although the Khmer Rouge with 30,000 to 40,000 hardened guerrillas, remain the strongest military threat to the estimated 160,000 to 180,000 Vietnamese occupation troops in Cambodia, the brunt of Hanoi's current dry-season offensive along the Thai-Cambodian border has been borne by the Khmer front. Although this noncommunist organization fields roughly 16,000 relatively inexperienced fighters, western diplomats said, it represents a far more serious political threat to the Vietnamese than the widely hated Khmer Rouge.

According to Gen. Picht, the Khmer front guerrillas performed reasonably well "against heavy odds" in defending Ampil.

However, the fighters who withdrew from Ampil looked dispirited, and Khmer front leaders clearly were at pains to explain how the tank-led Vietnamese troops managed to drive through the camp's vaunted defense lines so easily in their long-expected attack.

"I think it was a debacle," said a western official at the border.

The key to the Vietnamese success, according to western sources, was an intense artillery barrage followed quickly by a lightning tank-led breach of the camp's defensive perimeter and the explosion of Ampil's main munitions depot.

Picht said 3,000 to 4,000 Vietnamese troops were involved in the attack, backed by a dozen Soviet-built T54 tanks and about 20 armored personnel carriers. The number of Vietnamese casualties was not known.

And the Vietnamese attack did not cause many civilian casualties, Picht noted, because the camp's 23,000 population had already been evacuated to a site about 2 1/2 miles away on Thai soil.

Picht denied that Thai forces were providing artillery or other support to the Khmer front, insisting that Thai gunners fired only in response to Vietnamese shells that overshot the border.

Farther north, however, it was apparent that more direct clashes were involved between Thai and Vietnamese forces. The Thai supreme commander, Gen. Arthit Kamlang-ek, announced that an Air Force A37 Dragonfly plane was shot down while supporting ground troops engaged in a "clearing operation" near the border.