TOKYO (AP) _ The dollar weakened against the Japanese yen in light trading Wednesday, and prices on the Tokyo Stock Exchange fell on profit-taking.

The dollar closed at 108.45 yen, down 0.40 yen from Tuesday's close of 108.85 yen but higher than its late overnight New York rate of 108.13 yen.

After opening at 108.03 yen, the dollar ranged between 107.77 yen and 108.60 yen.

''There's no fresh market-affecting news, and the dollar weakened following its overnight decline overseas,'' said Yuko Fukakusa, a Tokai Bank analyst.

''And there's no active yen-buying either, ahead of Sunday's election,'' she said.

The election is for all 511 seats in the powerful lower house of Japanese parliament. Political instability is foreseen as the governing Liberal Democrats, split and scandal-ridden, are expected to fall short of a majority for the first time in nearly four decades.

The dollar was sold as market participants concluded that last week's vaguely worded U.S.-Japan trade agreement would have little tangible effect on Japan's snowballing surplus, said Shin Kobayashi, a dealer with Daiwa Bank.

Kobayashi was referring to an agreement in Tokyo Saturday in which Japan promised in general terms to expand its domestic demand, improve its market access for foreign products and slash its surplus with the United States, which reached nearly $50 billion in 1992.

The accord somewhat eased market perceptions that the United States would continue to press for a strong yen to make Japanese exports more expensive and imports cheaper in Japan.

Those perceptions have helped push the dollar down 16.45 yen, or 13.2 percent, from its 124.90-yen level at the start of this year.

After Saturday's accord, the dollar advanced at one point to a high of 110.40 yen in global dealings Monday.

On the stock market, the 225-issue Nikkei Stock Average lost 41.31 points, or 0.20 percent, closing at 20,139.11. The benchmark index had gained 200.42 points, or 1.00 percent, to 20,180.42 on Tuesday. It was the first time the Nikkei index had closed above 20,000 points since its 20,045.88 finish on June 15.

Traders said profit-taking on big gainers in the last few days helped send prices down. The Nikkei average had gained a total of 491.75 points, or 2.49 percent, over the last three trading days.

The Tokyo Stock Price Index of all issues listed on the first section was down 3.73 points, or 0.23 percent, to 1,631.58. On Tuesday, it had added 21.63 points, or 1.34 percent, to 1,635.31.

As of 3 p.m., the price of the No. 145 10-year Japanese government bond stood at 107.66 yen, down 0.17 yen from Tuesday's close of 107.83 yen. Its yield climbed from 4.260 percent to 4.285 percent.