Japan's former prime minister, Kakuei Tanaka, who resigned in a scandal, enjoyed a rare moment in the sun yesterday, thanks to the visit here by China's vice premier.

Teng Hsiao-ping paid a courtesy call on the disgraced former leader, who stepped briefly back on the public stage for the first time in two years. He seemed cheerful and relaxed with Teng but a sudden unpleasant encounter with the press left him angry and sullen.

Tanaka was prime minister in 1972 when Japan and China resumed normal relations and Teng, who is in Tokyo to honor the new peace treaty between the two countries, asked to see him.

In November 1974, Tanaka resigned following disclosures about his private business interests and he is now on trial on charges of having used his influence in the Lockheed bribery scandal. He is rarely seen at public events, although his influence in the parliament is still considerable.

Teng called on Tanaka at his private estate on central Tokyo, where the former prime minister had assembled about 40 members from his parliamentary faction. They met briefly in private and then emerged to toast one another with sake.

Teng thanked him for his role in bringing the two countries together and invited him to visit Peking. Tanaka said he would have to discuss that matter with his government.

After Teng had gone, a Japanese reporter asked about Teng's reaction to the Lockheed affair and Tanaka's mood turned bitter. "Don't say that," he told the reporter. "That's why I don't like to let you people in here."

He said Teng had not asked about the Lockheed affair and suggested that the indirectness of the Chinese in such matters was preferable to questions from reporters.

Teng's visit to Tanaka presented an embarrassing issue to the Japanese government. According to one published report, the government insisted that it be held at a private residence, not in a public room. The Foreign Ministry declined to confirm or deny that report.

Later, Teng called on another of Prime Minister Takeo Fukuda's political enemies, Masayoshi Ohira, who will make a bid for the prime minster's office in December elections. Ohira was foreign minister in the Tanaka cabinet in 1972.

Teng is in the midst of an eight-day visit, heading the first high-level Chinese mission to this country in many years.

Meanwhile, the Soviet Union continued to express disapproval of the treaty of peace and friendship between China and Japan. It contains a clause opposing the dominance of any country in Asia. China considers the clause a warning to the Soviets but Japan officially denies it is directed against any specific third country.

The official Soviet news agency, Tass, denounced the treaty Monday night, asserting that it is "known to be directed against the interests of peace and security in the Far East." It also warned that the treaty would lead to "intensification of militarist tendencies in Japan."