The state of Michigan, its treasury almost empty, is getting a little fiscal refueling from the country that caused many of its problems: Japan.

Gov. William G. Milliken announced yesterday that five Japanese banks have agreed in principle to give the state a $500 million line of credit that guarantees repayment of revenue notes the state plans to issue in the fiscal year beginning Oct. 1.

The state expects to save $20 million in interest on the notes, the governor said, because the Japanese guarantee means lower rates. For the Japanese, the deal means $6.25 million in fees, at little risk, and perhaps a measure of political good will in a state where bitterness about Japanese inroads into the automobile market runs deep.

The Japanese were rewarded immediately with a verbal pat on the back from Milliken, who praised them as constructive partners for his state. "Japan is one of our largest export customers, as well as one of our largest investors, and we welcome this step to strengthen the long-term economic development relationship between Michigan and Japan," he said.

The letter of credit, arranged by the Merrill Lynch White Weld Capital Markets Group, is to be issued by Mitsubishi Bank, Dai-Ichi Kangyo Bank, Fuji Bank, Sanwa Bank, and the Long-Term Credit Bank of Japan.

Michigan does not plan to borrow any money from them. The state, like many others, sells short-term notes on the open market to raise funds to meet current obligations, in anticipation of taxes to be collected later in the fiscal year. But Michigan has the lowest credit rating of any state in the union, which means that investors would demand very high interest rates on the notes if they were willing to buy them at all.

Backed by the Japanese guarantee, Milliken said, the state expects to receive the highest possible ratings for the new year's issue from the Wall Street credit evaluation houses, making it possible to market the notes at an interest rate of 10 percent or less, compared to the 14.35 percent paid this year.

Karen Gifford, the Merrill Lynch vice president who arranged the guarantee, said she and state officials did not set out with the intention of going to the Japanese. "We talked to many, many people," she said, "and our feeling was this was the best offer we could get."