Japan's conservative ruling party retained its narrow majority in the upper house of Parliament tonight in an election hailed by Premier Takeo Fukuda as a vote for political stability.

With results in on all of the 126 seats at stake, the ruling Liberal Democratic Party had won 63 and was sure of the backing of at least two independents.

This gave the Liberal Democrats a margin of one in the upper house, half of whose 252 members face re-election every three years.

There had been widespread predictions before yesterday's voting that the ruling party would lose its majority as part of a continuing erosion of support highlighted by a big setback in Demcember's lower house election.

Fukuda's party, hurt by the $12.6 million Lockhead bribery scandal after ruling Japan for 22 years, suffered a setback in the lower house election but scraped together a majority with 11 independents.

THe Lockheed affair has faded as a major political issue, however, and the nation's largest newspaper said the electorate was more concerned this time with economic problems.

The Asahi Shimbun, an independent newspaper, said the poor showing by the left-wing opposition, the Socialists and the Communists, was due to their failure to propose realistic remedies to Japan's poor economic situation and other major problems.

Desperate last-minute campaigning by Premier Fukuda and the scattering of votes among nine other parties and independents combined to produce a strong Liberal Democratic showing.

Fukuda said tonight that his party's solid showing indicted a general desire for political stability, and he had no plans to call a new lower house election.

During the campaign, Fukuda said he might dissolve the lower house if the upper house election led to a stalemate.

The Japan Socialist Party - split between its left and right wings - won only 27 of the 32 seats it was defending.

The Komeito (Clean Government) Party won 14 seats, the centrist Democratic Socialist Party took 6 the Communist Party 5 and the New Liberal Club - a breakaway from the Liberal Democratic Party - won 3. Three other seats went to minor parties and five to independents.

The Home Affairs Ministry said about 68.5 per cent of Japan's 78 million eligible voters cast ballots yesterday at about 49,800 polling stations. The turnout compared to 73.2 per cent in 1974 and 59.3 per cent in 1971.

Official sources said the Liberal Democrats' strong performance would help the government in settling outstanding international problems, including the signing of a Japan-China peace treaty, Japan-Soviet fishery negotiations and the country's huge trade surplus with the United States.

Observes said the Liberal Democrats were able to maintain their traditionally strong rural support while mobilizing supporters in an all-out campaign effort to offset numerous forecasts of defeat.

Fukuda, 72, campaigned vigorously for party candidates, traveling widely by commuter train, limousine and plan to tell rallies that only his party had the experience to lead the nation.

The ruling party also enjoyed the active support of Japan's industrial and banking circles, said Toshio Dodo, presiedent of the influential economic organization Keidanren.

The New Liberal Club, formed in the wake of the Lockheed scandal by disillusioned members of the ruling party, did worse than had been expected. Observers said the party relied too heavily on its youthful image and the novelty of that approach lost its appeal by election time.

One party leader who conceded total defeat was militant feminist Milsako Enoki, whose Japan Women's Party failed to elect any of its 10 candidates.

Enoki said before the vow that if her candidates were elected, they would karate-chop male chauvinist legislators to establish female supremacy.

After the election results were in, she announced: "I've finished with women's liberation movements and will go back to my husband."