Vietnam says it will withdraw 50,000 troops from Cambodia by the end of the year and put its remaining forces under the command of the Cambodian government, a Western diplomat said Thursday.

A senior Vietnamese Foreign Ministry official made the announcement on Wednesday to a group of foreign diplomats in Hanoi, the diplomat in Bangkok said.The diplomat, quoting a cable from his country's embassy in Hanoi, said he had no other details. He gave the information on condition of anonymity.

The development came in advance of Sunday's start of the Moscow summit, at which President Reagan has said he will ask Soviet leader Mikhail S. Gorbachev to encourage the Vietnamese to resolve the Cambodian conflict.

The Soviet-armed Vietnamese invaded Cambodia in late 1978 and are fighting guerrillas backed militarily or diplomatically by China, non-communist Southeast Asian countries and the United States.

Vietnam says it has made six annual partial pullouts from Cambodia since 1982 and that a total of 20,000 troops returned home in the most recent and largest one last November.

The United States says that was the only genuine withdrawal, and it estimates that 120,000-125,000 Vietnamese troops remain in the country battling about 50,000 guerrillas.

Vietnam has said the withdrawals were possible because the government it installed in Phnom Penh has grown stronger and its forces can take over the battle.

Hanoi has pledged a complete withdrawal by 1990, whether or not there is a political settlement but has warned it will take unspecified action if the guerrillas take advantage of the pullout to try to return to power.

In exchange for rights at Vietnam's numerous military bases, the Soviet Union gives Vietnam several billion dollars a year in aid.