Urho Kaleva Kekkonen, Europe's elder statesman who for a quarter of a century guided Finland on a narrow path between East and West, resigned as president yesterday.

Stricken last month with a respiratory infection and blood circulation problems in the brain, Kekkonen, 81, took sick leave Sept. 10.

The government issued a statement in Kekkonen's handwriting, which appeared very shaky, saying he was permanently disabled. Doctors said in a medical certificate that Kekkonen's arteriosclerosis "during the past few months has progressed to a stage that it now causes permanent hindrance to the performance of his duties."

Elections have been set for Jan. 17 and 18 to pick an electoral college that will choose the president on Jan. 26. Kekkonen will formally remain in office until his successor is sworn in Jan. 27, the government said.

Deputy Prime Minister Eino Uusitalo paid tribute to Kekkonen, saying: "The Finnish people have had to rely time and again on his long experience and his cool powers of judgment when confronted with problems of external and internal affairs."

Indeed, using his unrivaled political skill, Kekkonen managed to make the best of his country's precarious position as a neighbor of the Soviet Union with which it shares 800 miles of border. Finland became a bridge builder between East and West during his 25-year administration, and it will be hard for any politician to follow him.

Prime Minister Mauno Koivisto, 57, a Social Democrat, has been acting president for the past month, and recent polls showed him favored by 60 percent of the voters.

While the Kekkonen era -- marked by the continuous search for stability through neutrality -- has ended, Finland is likely to continue on that course.

Finnish officials do not see any immediate danger from the Soviet Union because of the change of leadership in Helsinki. But Finland's stability always rises and falls with world tension.

The credit for Finland's stability during the past quarter of a century must go to Kekkonen.

As early as 1943, when Finland was still at war with the Soviet Union, and when nearly every Finnish home was mourning a family member killed in action, Kekkonen, then a member of parliament, called for "neighborly relations with the hereditary enemy."

The idea was not popular at the time. But Kekkonen suggested that conciliation with the Soviet enemy was Finland's only hope for lasting peace.

It was typical of Kekkonen to advocate ideas whose time had not yet come, and he tenaciously campaigned for them until his countrymen were ready to accept them.

In the 1940s his views did coincide with those of then president J.K. Paasikivi who built the framework for Finland's neutrality. Kekkonen succeeded Paasikivi in 1956, after serving as prime minister in five Cabinets. But Kekkonen developed his predecessor's policy into what became known as "active neutralism."

"What is decisive is that the neutrality policy has credibility. Without the trust of others in a country's neutrality, it is doomed to failure," Kekkonen once said.

He developed that trust with the Soviet Union by never giving its leaders reason to fear for Soviet security -- a fear that had sparked two Russo-Finnish conflicts, in 1939-40 and in 1941-44. Finland lost both wars.

As justice minister in 1944, Kekkonen helped work out the peace treaty with the Soviet Union.

Kekkonen's detractors -- there were more during his early years as president -- called him an appeaser who would knuckle under to Soviet economic and military demands.

In the West the term "Finlandization" was often used. Kekkonen bridled at the term for its implication of uncritical accommodation.

Finland does try to avoid confrontation with the Soviet Union. It has discouraged the use of its territory by Soviet refugees. It also has played down criticism of such Soviet actions as the suppression of the Hungarian uprising in 1956, the invasion of Czechoslovakia in 1968 and of Afghanistan in 1979.

Kekkonen would argue that such restraint is in no way a limitation of sovereignty, but rather a political preference.

Finland is politically and culturally oriented toward the West and in particular its Scandinavian neighbors. Under Kekkonen, Finland concluded trade agreements with several East European countries and the Soviet Union and also with the European Community.

What Kekkonen knew better than anyone else, with the possible exception of Yugoslavia's late president Josip Broz Tito, was how to create trust on the part of Soviet leaders.

He conferred regularly with Soviet leaders and came to know them intimately. That, of course, made him an even more welcome guest of Western leaders, particularly during the height of the cold war.

Kekkonen, who traveled to the Soviet Union at least once a year, developed a close relationship with Nikita Khrushchev. The two leaders debated the relationship between their countries for many hours in the heat of Kekkonen's sauna.

The two men could share a joke, but Kekkonen was also firm, even blunt.

In 1960, shortly after the shoe-thumping incident at the United Nations, Kekkonen was Khrushchev's guest at a Kremlin banquet. During a private talk Kekkonen reached under the table pulled off his shoe and pounded the table under his host's nose in imitation of the way the Soviet leader had brandished his shoe before the General Assembly. Khrushchev roared with laughter.

Yet, a few months later, when Kekkonen received Khrushchev in Helsinki, he told his guest during a speech at the Soviet Embassy: "Even if the whole of Europe turns communist, Finland will remain traditionally democratic, if this is the wish of the people of Finland, and I believe it is . . . . The leaders of the Soviet Union know that we will defend our own system in all circumstances, because we think it is better for us."

Relations with the Soviet Union were formalized in the 1948 Treaty of Friendship and Cooperation that, Kekkonen, then a member of parliament, helped work out.

Many in the West believed the treaty would seal the fate of Finland as a Soviet satellite. They were wrong. The treaty was extended in 1970 for 20 years. It stipulates that Finland wishes to remain outside the power blocs and will not allow any invader to use its territory to attack the Soviet Union.

Over the years Kekkonen won the respect of both East and West. In 1980 he was awarded the International Lenin Peace Prize, and he has been a top contender for the Nobel Peace Prize many times.

Thus Kekkonen seemed an ideal host for the Strategic Arms Limitation Talks and the 1975 Helsinki summit of the Conference for Security and Cooperation in Europe, which affirmed Europe's postwar borders.

He was elected president four times, in 1956 with the smallest possible margin, in 1978 almost unanimously. His current term would have expired in 1984.

He was born Sept. 3, 1900, the eighth son of a forestry worker in the remote village of Pielavesi in central Finland. His home for 17 years was the working-class neighborhood of a small town, Kajaani, in northeastern Finland. His parents sacrificed to give him an education almost unheard of for his social background. Eventually he earned a doctorate of law.

Throughout his political career he remained unassuming.

He reserved the downtown Presidential Palace for official activities, preferring to do most of his work at his home, a 20-minute car ride away.

During official functions he sometimes gave the impression of remoteness. Columnist Carl Rowan, who was ambassador to Finland in 1963-64, described him as "introvert." But he added that "like most Finns, he could be quite pot-valiant relaxed and friendly after a drink ."

"What impressed me most about this man was his great intellectual strength, which he applied constantly to control the political situation in Finland. He used to be a tremendously active person."

A tall, lean athlete, Kekkonen could frequently be seen on his early-morning jog; in the winter he would ski cross country daily, for 12 miles or more. He kept this regimen until almost a year ago.

In his youth Kekkonen was a renowned sportsman. He held the national record for high jumping in 1925.

In 1926 he married Sylvi Uino, a writer of romantic novels. Since his wife's death in 1974, he has lived alone.

The couple's twin sons, Matti and Taneli, born in 1928, both pursue careers in public life.