Chancellor Angela Merkel's party endured a second setback in a state election in two weeks on Sunday, as many voters turned to the left and right in Berlin, according to projections based on exit polls.

The Social Democrats (SPD) and Merkel's Christian Democratic Party (CDU) emerged from the Berlin state election as the strongest two parties, but both lost enough support that they won't be able to continue a coalition government, the projections show.

The SPD won 21.6 percent of the vote, dropping 6.7 percent, while the CDU won 17.5 percent, down 5.8 percent, ARD public television reported.

At the same time, the anti-capitalist Left Party, a descendant of the former East German communists, gained 4 percent to 15.7 percent overall and new nationalist anti-immigrant Alternative for Germany, known as the AfD, easily entered its 10th state parliament with 14.1 percent of the vote.

Voter participation was up to 66.6 percent from 60.2 percent in the last election, and the AfD drew a lot of its support from new voters, though it was also able to attract supporters from both the SPD and CDU and other parties.

The vote comes two weeks after Merkel's CDU was beaten into third place in the eastern state of Mecklenburg-Western Pomerania by the AfD, in which the chancellor's decision to open Germany's borders to migrants last year featured prominently. Sunday's showing — her party's worst ever in the capital — will keep up the pressure on the chancellor a year ahead of national elections.

However, it was largely local issues that drove the vote in the city of 3.5 million. Among other things, disillusionment is high over the capital's notoriously inefficient bureaucracy and issues such as years of delays in opening its new airport.

Peter Tauber, the Christian Democrats' general secretary, blamed Social Democratic Mayor Michael Mueller for turning voters against the two governing parties, saying "the fish stinks from the head."

Mueller, however, said after the results that "We have achieved our goal."

"We are the strongest political party and we have a mandate to form a government," he said.

With the AfD's strong showing, national party co-chairman Joerg Meuthen said his party was strongly positioned for next year's national elections.

"We are firmly convinced that we will end next year with a double-digit result," he said.

Sigmar Gabriel, the national head of the Social Democrats, which govern in a coalition with Merkel's Christian Democrats, said "we don't find it good" that the AfD will now be represented in the city-state of Berlin's parliament.

"But almost 90 percent of voters did not vote for them, and that's also important," he said.

Without enough support for the governing SPD-CDU "grand coalition" to continue and with five parties with very similar strengths, a three-way coalition will almost certainly form the next government. The most likely is a combination of the SPD, Greens, which won 15.1 percent, and Left party.

Such a configuration "is not a good perspective for Berlin," Tauber said on Twitter.

The vote saw the Pirate party voted out of state parliament, and the pro-business Free Democratic Party winning 6.7 percent of the vote — enough to bring it back in to parliament.