Austrian Chancellor Bruno Kreisky announced tonight he will retire from office, ending 13 years in power, after election results showed his Socialist Party had lost its absolute majority in parliament.

Kreisky said he was stepping down from the top office but would remain active as party leader. He had been in office longer than any other Western European leader.

The Socialists received about 48 percent of today's vote and lost five seats to end up with a total of 90, falling two short of a majority in Austria's 183-seat parliament, according to unofficial results. Their main opponent, the conservative People's Party, won 81 seats, an increase of four.

The Freedom Party, a liberal group espousing free market theories, gained one seat to raise its share to 12. Two environmentalist Green parties failed to receive enough votes for representation in parliament.

Kreisky's decision to relinquish power surprised the nation following an election considered a milestone in the country's politics. He frequently has said he would leave office unless his party retained its majority, but the campaign vow was widely perceived as a political bluff designed to extract maximum voting leverage for the Socialists.

In an interview in January, Kreisky expressed profound disgust for coalition government and called it a "frustrating, tiring exercise in confrontation politics."

Nonetheless, as party leader he will conduct the coalition negotiations that many analysts believe will result in a ruling center-left alliance between the Socialists and the Freedom Party.

Kreisky, 72 and in failing health, is expected to turn over the reins of government to his deputy prime minister, Fred Sinowatz, who currently handles educational affairs.

During his long tenure in power, preceded by a decade as foreign minister, Kreisky evolved into a powerful figure in the Socialist International. He developed a reputation as a statesman willing to explore all channels in the search for an Arab-Israeli peace and better relations between rich and poor nations.

An ardent defender of the Palestinian cause, Kreisky maintained close contacts with Palestine Liberation Organization Chairman Yasser Arafat. He also set off a furor by inviting Libya's Col. Muammar Qaddafi to Austria, dismissing criticism of the invitation by stressing the value of dialogue with all elements in the Middle East.

Some of Kreisky's most vitriolic words were aimed at the policies of Israel's Prime Minister Menachem Begin. He often called Begin a major obstacle to peace and, in turn, was vilified by the Israeli government as a traitor to his Jewish heritage.

Looking tanned and relaxed, Kreisky tonight seemed fatalistic about what he called the difficulties of "maintaining a majority for so long."

He thanked "the 48 percent of the people who supported the Socialists" and said that he would continue to play a major role within his party.

The campaign was dominated largely by the sensitive issue of Kreisky's health. In recent years, the chancellor has suffered from eye trouble and diabetes and must undergo dialysis treatment three hours a day twice a week to cope with a kidney ailment.

Alois Mock, 49, the leader of the People's Party, frequently warned voters that Kreisky was likely to prove too ill to administer the government for another four-year term.

"Kaiser Bruno," as he is affectionately known, broached the charge of being too sick to serve with typical candor. "I am not as healthy as I might like," he told campaign audiences. "But I am a long way from being as ill as many in the People's Party would wish."

Kreisky sought to put his opponents on the defensive by emphasizing his government's remarkable success in insulating the Austrian economy from the debilitating blows of the world recession.

While much of Europe has been buffeted by double-digit inflation and unemployment, Austria has managed to keep both indicators below 5 percent.

Consumer prices are expected to rise by less than 4 percent this year, and unemployment, while growing, amounts to only 4.5 percent of the work force.

The conservatives insisted that Kreisky was seeking to claim undue credit for the country's well-tended tradition of close cooperation among union, business and government that makes strikes extremely rare here.

They also attacked Kreisky for expected higher taxes and a rising state debt. Debt is now put at $20 billion, and many analysts believe it will expand rapidly soon because of poor investments and costly loans. Kreisky risked a wave of unpopularity early in the campaign by announcing that the Socialists would impose a 20 percent tax on interest earnings and work bonuses after the election.

The poor performance of Austria's two Green parties also surprised election analysts, who expected that they would capture as much as 10 percent of the vote on the coattails of West Germany's Greens, who succeeded in winning 27 parliamentary seats in last month's election.

The Austrian Greens, however, were handicapped by the absence of issues here that won them popularity in West Germany. One of the least polluted countries in Europe, Austria has ruled out nuclear power plants as an energy source and, as a neutral country, does not intend to allow deployment of nuclear weapons aimed at the East Bloc.

Moreover, their prestige was battered during the campaign by an unseemly row between two leaders of one of the groups, the United Greens of Austria.

A gossip magazine created a furor by publishing explicit accounts of rumored amorous escapades of one of the leaders, Herbert Fux, a well-known actor who has specialized in playing the villain in Austrian movies. The other leader, Alexander Tollman, a conservative geology professor, said the lurid publicity demeaned the Greens' cause.