BERLIN — Austria was split in half Sunday in a cliffhanger presidential election in which far-right candidate Norbert Hofer held a narrow lead over his left-wing challenger in a vote that will not be decided until nearly 1 million absentee ballots are counted Monday.

Hofer is a leader in the Freedom Party and is attempting to become the first far-right head of state in western Europe since World War II. He benefited from a backlash against immigrants and widespread frustration with Austria's mainstream parties.

With nearly 5 million votes counted Sunday, he led by a scant 144,000.

Analysts have compared Hofer's “Austria first” platform to the campaign run by U.S. Republican presidential candidate Donald Trump. Hofer is opposed to Muslims, refugees and trans-Atlantic trade agreements that he says are eliminating jobs in Austria, where unemployment has doubled to 10 percent in the last three years.

The election for the ceremonial office had drawn widespread international attention amid fears that the rise of Hofer and the far-right in Austria could pave the way for far-right parties in France, the Netherlands and across Europe to take power.

But Hofer encountered strong opposition from Alexander Van der Bellen, an economist who was the leader of the Greens party for 11 years, until 2008. Van der Bellen ran as an independent but had the support of all other established parties. He promoted an open-doors policy as well as greater development of renewable energy.

The ORF public television network said the results were too close to call. The candidates appeared in a joint interview saying they did not expect a winner to be declared until Monday.

“I've never seen an election as close as this,” Hofer told ORF. His campaign had appealed to fears that Austria has been overrun by foreigners after the coalition government let in some 90,000 refugees fleeing the war in Syria and turmoil in the Middle East.

Hofer rejected charges that his election could damage the image abroad of Austria, which relies heavily on foreign trade and tourism. He called media reports abroad that his election would be tantamount to Europe's most dangerous lurch to the right since 1945 “completely absurd.”

“Anyone who looks at our party's program and compares it to the Republicans in the United States will quickly see that we're not a far-right party. I'm the center-right,” he said.

In his campaign, Hofer vowed to put “Austria first” and “stop the invasion of Muslims.” Exit polls found that Hofer was far ahead among men and voters without high school diplomas.

Hofer's political success comes as Austria, a nation of 8.7 million, has shifted to the right in the last year after it first allowed more than 90,000 asylum seekers fleeing war and poverty into the country and then closed its borders.

In the first round of voting April 24, the ruling Social Democrats and their conservative People's Party allies experienced a loss that led to a government upheaval this month. Chancellor Werner Faymann abruptly resigned after over seven years in power, and the former head of the national railway, Christian Kern, was sworn in last week as Faymann's replacement.

In April, Van der Bellen got 21 percent of the vote to Hofer's 35 percent.

Analysts expressed surprise that the race was so close now, saying a heavy turnout in Vienna and other regions had helped Van der Bellen. They said fears a Hofer victory could lead to Austria being isolated in Europe had helped raise the turnout to above 70 percent.

“I'm surprised that Van der Bellen was able to catch Hofer,” said Dieter Segert, a political scientist at the University of Vienna. “It shows that about half the country is worried about the Freedom Party.”