The radical right-wing candidate running for Parliament in Poland’s deep south wants to slash taxes, regulations on business and welfare benefits. Most striking, however, is his vow to remove a small Ukrainian flag that was hoisted last year on a town hall balcony as a gesture of solidarity with Poland’s eastern neighbor.

He wants it taken down, not because he supports Russia, he says, but because Poland should focus on helping its own people, not cheering for Ukraine.

In a country where millions of citizens rallied last year to help fleeing Ukrainians, and where the government threw itself into providing weapons for use against Russia’s invading army, complaints about the burden imposed by the war used to be confined to a tiny fringe. A general election set for Sunday, however, is pushing them toward center stage.

That is due in large part to the vocal carping about Ukraine from candidates like Ryszard Wilk, the owner of a small photography business in the southern Polish town of Nowy Sacz. He is the electoral standard-bearer in the region for Konfederacja, or Confederation, an unruly alliance of economic libertarians, anti-vaxxers, anti-immigration zealots and belligerent nationalists that is now unusually united in opposition to aiding Ukraine.

“We have already given them too much,” Mr. Wilk said in an interview early this week. He was traveling during a campaign swing through his mountainous and deeply conservative home region, a longtime bastion of support for Poland’s right-wing governing party, Law and Justice.

“We don’t want Ukraine to lose the war, but the burden on Poland and its taxpayers is too high,” Mr. Wilk added. “Poland should be helping Poles.”

The growing reservation in Poland comes at a critical time for Ukraine, which is struggling in its counteroffensive against Russia and scrambling to stem an erosion of support from Western allies. Sunday’s vote in Poland comes after an election two weeks ago in neighboring Slovakia that was won by a Russia-friendly populist party that wants to halt sending arms to Ukraine.

Long dismissed by liberals as a collection of extremist cranks, Konfederacja has jumped on the question of how much Poland should help Ukraine as a potential vote-winner, channeling what opinion surveys show to be modest but growing currents of anti-Ukrainian sentiment.

Konfederacja is still less a party than a jumble of niche and often contradictory causes — from small-state libertarianism to big-state nationalism — but “they are all anti-Ukrainian, though for different reasons,” said Przemyslaw Witkowski, an expert on Poland’s far-right who teaches at Collegium Civitas, a private university in Warsaw.

“Anti-Ukraine feeling and sympathy for Russia is one of the few elements that glues them all together,” he added.

Konfederacja has no chance of winning on Sunday and opinion polls indicate that its public support, which surged to 15 percent over the summer, slipped after Law and Justice started echoing some of its views, particularly on Ukraine. By threatening to outflank the governing party, itself a deeply conservative force, on the far right in a tight election, Konfederacja helped prod the Polish government into curbing its previously unbridled enthusiasm for backing Ukraine.

The result has been a sharp souring in recent weeks in relations between Warsaw and Kyiv, particularly over Ukrainian grain imports. The issue triggered an ill-tempered tiff last month when Poland’s government, led by Law and Justice, banned the import of grain from Ukraine in an effort to protect Polish farmers — and avoid defections in its vital rural base.

President Volodymyr Zelensky of Ukraine exacerbated tensions by insinuating in a speech at the United Nations that Poland, by blocking grain deliveries, had aligned itself with Russia. And last month, Ukraine filed a complaint against Poland with the World Trade Organization over grain.

Infuriated by what it saw as Mr. Zelensky’s ingratitude, Poland denounced the Ukrainian president’s remark as “astonishing” and “unfair.” It also briefly suggested it was halting the delivery of weapons but, after an uproar, said arms would continue to flow.

Fearful of losing its grip on Ukraine-skeptic voters to Law and Justice, Konfederacja leaders in Warsaw drew up a bill totaling 101 billion Polish zloty (around $24 billion) to cover all the money they said Ukraine owed Poland for military and other aid like assistance to the millions of Ukrainians who fled the war.

In Nowy Sacz — the capital of an electoral district encompassing farmland and resort towns — Mr. Wilk sent a letter to the local mayor demanding, unsuccessfully, the removal of a Ukrainian flag from the town hall and an end to welfare payments to refugees from Ukraine.

“We see no reason to pay benefits to foreigners, we see no reason for Ukrainians to receive Polish pensions,” Mr. Wilk wrote. “We see no reason for hanging the flag of a country that is declaring a trade war on us and complaining to the W.T.O.”

Sunday’s election, which opinion polls indicate will be a tight race between Law and Justice and its strongest rival, Civic Coalition, a grouping of center-right and liberal forces, is unlikely to put Poland on the same openly anti-Ukrainian path as Hungary or Slovakia.

But the fight for votes has introduced a level of discord that has already comforted the Kremlin’s hopes that Western solidarity with Ukraine is fraying, even in Poland, where hostility to Russia runs very deep.

And if, as opinion polls suggest is likely, neither of the top two parties wins enough seats to form a new government on its own, Konfederacja could become a potential kingmaker, though it insists it won’t join either of the front-runners in a coalition government.

Mr. Wilk, who heads the party’s list of candidates in the south, said the earlier program was meant as a joke and did not reflect Konfederacja’s current direction. “We are definitely a right-wing party, but mostly on economics, not this other stuff,” he said.

Surveys of public opinion suggest that bashing Ukraine is not something most Poles want, but that it resonates among some voters as the war drags on.

Eighty-five percent of Poles, according to a study released this summer by the University of Warsaw, want to help Ukraine in its war with Russia, but the share of respondents with a strong preference in favor of Ukraine fell to 40 percent in June from 62 percent in January. And the study found that “for the first time, we are dealing with a situation when the majority of Poles (55 percent) are against additional aid.”

An outdoor barbecue organized last Sunday by Konfederacja for voters in the mountain resort town of Zakopane drew only a handful of people, though it was cold and rainy. Those who did attend, all men, were fully behind the party’s stance on Ukraine.

“I will never tolerate the Ukrainian flag flying here in Poland,” said Wojciech Tylka, a professional musician who brought his three children along to hear Mr. Wilk and fellow candidates rail against taxation, social benefits and Ukraine’s drain on Polish resources. “Only the Polish flag should fly.”

“If Ukrainians don’t like this, they should go home,” Mr. Tylka added.

Disgusted by politicians of all stripes, Mr. Tylka said he had not voted in an election for more than 15 years, but that he would definitely vote for Konfederacja on Sunday.

Desperate to hang on to conservative voters in the region, Law and Justice sent one of its best-known known national figures, Ryszard Terlecki, to lead its list of candidates in the district.

Appearing Monday at a raucous pre-election debate at a university in Nowy Sacz with Mr. Wilk and four other opposition candidates, Mr. Terlecki said that Law and Justice would continue to help Ukraine “but must also take Polish interests into account.” He defended the government’s ban on the import of Ukrainian grain.

Józef Klimowski, a shepherd whose flock of sheep blocked access to a recent campaign event for Mr. Wilk, said he didn’t care about politics but would vote for Law and Justice because it had found sponsors for his favorite local ice hockey team.

After the debate, Artur Czernecki, a local Law and Justice politician, said he understood why Mr. Wilk has made an issue of Ukraine and its flag on Nowy Sacz’s town hall: “Every party is looking for ways to stand out,” he said. But, as deputy speaker of the City Council, Mr. Czernecki added that he would not allow the flag issue to be put to a vote, at least not until the election is over.

“I just hope that after the election everything will calm down,” he said.

Anatol Magdziarz in Warsaw contributed reporting