TOKYO, DEC. 27 -- A Japanese legislator has been charged with evading nearly $13 million in taxes on stock profits, prosecutors announced today, a day after he resigned from the governing party.

The case is a new blow to Prime Minister Toshiki Kaifu's Liberal Democrats. The party was discredited last year by a scandal over political donations and bargain stock deals for influential politicians, bureaucrats and businessmen.

Legislator Toshiyuki Inamura was charged with evading $12.7 million in taxes on profits of $20.8 million from stock dealings from 1986 to 1988, according to prosecutors.

Inamura's personal physician, Akiyuki Yamaguchi, also was charged with evading $6.13 million in taxes in 1986-87, prosecutors said. The doctor allegedly provided insider information to Inamura from a man now being tried on charges of manipulating stock prices.

Inamura, former director general of the Environment Agency, could be assessed up to $23.7 million in back taxes and penalties, news reports quoted tax officials as saying.

Last year's scandal contributed to the resignations of two prime ministers. The Recruit Co., an information services conglomerate, was accused of trying to influence government policy with preferential stock deals and political donations.

Kaifu, chosen for his clean reputation, was made prime minister in August 1989 and pledged to restore public trust in politics. But reforms are still under debate, and Kaifu is locked in a struggle with powerful party faction leaders to prevent politicians implicated in the Recruit scandal from gaining ministerial posts.

In the Inamura case, the stock earnings were found to have been put to his personal use. Prosecutors said Inamura used part of his stock profits to buy a luxury home in Tokyo. The remainder was reinvested in stocks, they said.