When Prime Minister Masayoshi Ohira dissolved the lower house of Japan's Parliament for new elections two weeks ago, it was a safe bet that his Liberal Democratic Party would win the seats it needs for a solid working majority.

His party was enjoying unaccustomed popularity in public opinion polls. The opposition, especially the Socialists, was losing ground. Working in Ohira's favor were a strong business recovery and a low rate of inflation, usually an unbeatable combination.

Then the spotlight was focused on Ohira's plan to impose a new general excise tax on Japanese consumers and the optimism ebbed sharply. The tax, similar to a European-style value added tax, was first proposed months ago but got little attention until voters and Ohira's own party leaders began calculating what it would mean -- a sharp rise in consumer prices next year.

Almost overnight, his party's candidates in the Oct. 7 election began running for cover. In Tokyo's Shinjuku district this week, Kaoru Yosano, a young candidate running for reelection, warmed up a crowd waiting to hear Ohira by emphatically disassociating himself from the prime minister's tax.

"I will fight with my whole political life to prevent by all means the tax increase, during the election and after the election," Yosano declared. Ohira arrived a few minutes later and delivered a ringing endorsement of Yosano without mentioning taxes.

Opposition politicians, naturally, are having a field day at Ohira's expense. Socialist Party Chairman Ichio Asukata, battling uphill to save his own legislative seat, strongly opposes the tax in curbside speeches to partisans. He also warns that, in lieu of that tax, the government is scheming to raise regular income taxes by 20 percent on workers earning about $700 a month.

A Mainichi newspaper poll last week recorded 72 percent of the population against introduction of the tax, and, more ominously for Ohira, members of his party are defecting in droves on that issue. Toshio Komoto, chairman of the party's policy affairs research council, said the tax would not be necessary and said that 60 percent of party members are against it. More than 200 Liberal Democratic members of the parliament joined an ad hoc association devoted to opposing the tax.

It was a bitter pill for Ohira. He had long argued that the excise tax is necessary to reduce the government's chronic and growing revenue deficits and a party resolution had endorsed a plan to introduce it next year. Although some newspaper editorials praised him for facing the issue realistically, Ohira this week began amending his comments to flow with the tide.

First, he said the tax might be imposed only for a short time. Then he said he is not sure yet and won't be -- until after the election -- whether it will be needed at all. Perhaps, he added, an increase in regular income taxes would suffice.

The debate cast a dark cloud over Ohira's effort to win control of parliament. His party has been Japan's dominant party for a quarter of a century, but in recent years has governed with so thin a majority that it lacks effective control over the lower house. At the time Ohira dissolved the chamber on Sept. 7, the Liberal Democratic majority was a slender two votes.

His goal this fall is 271 seats (the party now has 248), which would be enough to obtain majorities on all standing committees, including the crucial budget committee, and also enough to end the need for constant negotiations with opposition parties.

Two weeks ago the prospect looked bright. A poll in the Asahi newspapers found that 52 percent of the people support the Liberal Democratic Party, a recent high mark, although support for the Ohira Cabinet was declining.

The major opposition party, the Socialists, has been declining in strength for years and last April was further demoralized by sound trouncings in several local elections in cities they and the Communists had governed for a decade or longer.

Another opposition party, Komeito, has never risen above 5 percent support in public opinion polls and this year is in disarray because of internal feuds within Soka, Gakkai, the Buddhist lay organization that is its major source of support and funds.

One of Japan's leading political consultants, Takayoshi Miyagawa, predicted later last month that for all of these reasons the Liberal Democrats probably would emerge from the election with 280 lower house seats, more than enough for a workable majority.

Miyagawa, president of the Center for Political Public Relations, Inc., noted the absence of promising leadership in any opposition party and said statistics he has gathered confirm a growing conservative trend. The ousting of Socialist and Communist governors in local races last spring showed that their policies had alienated voters, he said.

At stake also in the election is Ohira's personal future. Elected party president and prime minister last winter in an upset election, he currently lacks the factional clout that is enjoyed by other party leaders, including former prime ministers Takeo Fukuda and Kakuei Tanaka.

Before the tax issue clouded his prospects, Ohira was expected to gain adherents to his faction.

Miyagawa, the consultant, figured that Ohira would emerge with 50 loyalists in the lower house, second only to Fukuda in personal following. Now the outcome does not look so certain.