WARSAW, Poland -- Fighting for a second term as president, Lech Walesa staged a remarkable comeback in the first round of the election yesterday, gaining enough votes to face a former Communist in a runoff, surveys of voters leaving the polls showed.
Mr. Walesa, who trailed so badly several months ago that many Poles were writing his political obituary, was just behind Aleksander Kwasniewski, the surveys indicated. The Polish state television reported Mr. Kwasniewski with 34 percent of the vote and Mr. Walesa with 33.2 percent.
Because neither candidate received more than 50 percent, a runoff will be held Nov. 19.
Many analysts predict that Mr. Walesa will emerge triumphant in two weeks and win a second five-year term. They say voters who backed unsuccessful centrist candidates yesterday are likely to coalesce behind the former Solidarity leader to prevent a former Communist from winning.
The next two weeks of campaigning will match one of the world's best-known anti-Communists against Mr. Kwasniewski, who has remodeled himself as a modern, market-oriented politician.
Analysts suggest that Mr. Walesa will finally outstrip Mr. Kwasniewski by playing on fears that the old guard would have too much power with a former Communist as president joining Prime Minister Jozef Oleksy, also a former Communist.
At a polling station in an elementary school in the working-class Warsaw suburb of Wola, Robert Gawelkiewicz, 30, gave a sense of this worry. "It is a choice of a lesser evil," he said after voting for Mr. Walesa. "It is not a choice between persons, but between certain systems, sets of values and political groups."
While opinion polls in the last several weeks showed that younger voters preferred Mr. Kwasniewski, who is 40, they, too, seemed to go for Mr. Walesa in surprising numbers yesterday.
"Thanks to him, we are free," said Jacek Mosakowski, 26. "It is thanks to him we have passports and everyone can say what he believes."
Mr. Walesa made a tremendous comeback in the last month, rescuing what seemed like an impossible position behind many other candidates. The Nobel Peace Prize winner, who as head of the independent trade union movement Solidarity led the charge against Poland's Communists in the 1980s, became increasingly unpopular as president.
Many Poles found his rough speech from his days as a worker at the Gdansk shipyards unseemly for a head of state. Recently, he proclaimed: "I am a conceited buffoon. This is just how I was made."
His frequent involvement in the minutiae of Polish politics was also seen as inappropriate for the president of a country hoping to join Western institutions, particularly the European Union and the North Atlantic Treaty Organization.
But as the campaign got under way, Mr. Walesa changed course, becoming more statesmanlike and articulate. To improve his frayed image, he dumped his longtime chauffeur, Mieczyslaw Wachowski, who served as chief of Cabinet. Then he reminded Poles of his historic role, warning that the election of Mr. Kwasniewski would result in a "red triangle."
By this Mr. Walesa meant that the former Communists would control Parliament, appointments at all levels of government and the presidency.
There was little difference between Mr. Walesa and Mr. Kwasniewski on the issues. Both candidates said they would continue the market reforms that helped propel Poland's economic growth to 4.5 percent last year.
Growth is expected to be 6.5 percent this year, the highest in Europe.
Mr. Walesa and Mr. Kwasniewski both vigorously support Poland's entry into NATO as insurance against Russia. But Mr. Walesa was far tougher on the Russians, lambasting President Boris N. Yeltsin and emphasizing an anti-Russian theme popular among many Poles.
In the coming days, the Roman Catholic Church, which has stayed out of the campaigning so far, is expected to enter the fray by encouraging voters either explicitly or implicitly to vote for Mr. Walesa. Mr. Kwasniewski has alienated the church by vowing to sign legislation that would overturn the restrictive abortion law enacted in 1993 after extensive church lobbying.