A far-right party has won seats in the German parliament for the first time in half a century, in an election that saw Angela Merkel returned as chancellor for the fourth contest straight.

The German chancellor pledged to address the concerns of people who voted for the anti-Muslim and anti-immigration AfD after initial results showed it winning 13.5 per cent of the vote – at the higher end of what was expected.

Meanwhile, the centre-left SPD – the current coalition partners of Ms Merkel’s CDU and a titan of German politics for 150 years – have hit a historic low of just 20 per cent, the social democratic party’s worst showing since the Second World War.

Small parties in general did well in the election and were all up on their 2013 results, with the the liberal FDP re-entering the Bundestag with 10.5 per cent of the vote, the Greens on 9.5 per cent, and the left-wing Die Linke on 9 per cent. Turnout and voter participation also appears to have climbed since the previous election, which was held in 2013.

SPD leader Martin Schulz immediately ruled out going back into coalition with Ms Merkel, leaving the Chancellor likely to go into coalition with the liberals and the Greens – the so called “Jamaica Coalition” because the colour of the parties matches the country’s flag yellow, black, and green flag.

Such a coalition has not been formed at German national level before – though it does sometimes occur in Germany’s state parliaments, such as in the northern state of Schleswig-Holstein where it currently operates.

Ms Merkel could alternatively try to form a minority government if she is unable to secure the formal backing of other parties – with coalition negotiations expected to take weeks or even months.

The result is a huge blow for Mr Schulz, a former president of the European Parliament who became SPD leader earlier this year and once hoped to unseat Ms Merkel from the Bundeskanzleramt. His appointment as leader in March saw the SPD spike in the polls, but his honeymoon quickly faded.

Speaking after exit polls were released, Ms Schulz attacked “right-wing extremism” of the AfD and told supporters assembled in Berlin: “What is depressing for us tonight is the result of the AfD.

“For the first time with them there will be far-right representation in the Bundestag.”

Martin Schulz, the SPD leader, suffered a terrible defeat (Getty Images)

One of the largest cheers of the night from Mr Schulz’s address was his announcement that he would drop the coalition with Ms Merkel – a pact that has cause rifts within the SPD. Mr Schulz himself did not serve as a minister in the government, he says, because he wanted to replace Ms Merkel as chancellor.

In a speech following the exit poll, Ms Merkel attacked “illicit migration” and said “internal and domestic security” would be one of the focuses of coming months – an apparent nod to the AfD’s priorities.

She told assembled CDU supporters: “We got where we wanted to be, we wanted to be the strongest power. It is down to us to form a government, and against us, no government can be formed.

“After 12 years of being responsible for the government, the result we had today is really not something you can take for granted. Naturally, there’s a challenge facing us for the future, and that is that the AfD has made it into parliament.

“We will have to win back those who voted for the AfD by solving their problems, by taking on board their concerns – their fears in some cases – but also by demonstrating good policymaking.

Angela Merkel pledged to assuage AfD voters fears and win them back (Getty Images) (Getty)

“In recent months we have fought for a Germany that we want to live in well, and now we need to set the course to ensure that in five and ten years’ time it’s still the case.”

Alexander Gauland, the lead candidate for the AfD said: “The government, whatever it will look like, should get ready for tough times. We’ll chase them. We’ll take back our country and our people.”

The campaign was dominated by the AfD’s messaging on the refugee crisis and Muslims in particular, with the party’s anti-Islam posters littered all over German cities and towns.

The closest the Bundestag has come to having far-right MPs since the Second World War was the Deutsche Rechtspartei, or German Right Party, a hard-right national conservative outfit that attracted former Nazis and won five seats in the 1949 federal election. It lost those seats at the next election.

Other than the AfD, the most notorious contemporary German far-right party is the National Democratic Party of Germany (NPD). The NPD has previously won scattered representation in local state parliaments but has failed to ever win any seats in the Bundestag.

German election 2017 Show all 14 1 /14 German election 2017 German election 2017 German Chancellor Angela Merkel (R) poses for a selfie with a boy before addressing an election campaign rally of the Christian Democratic Union (CDU) in Kappeln Odd Andersen/AFP German election 2017 German Social Democrat (SPD) and chancellor candidate Martin Schulz speaks during an election campaign stop on September 20, 2017 in Gelsenkirchen. Schulz trails Chancellor and Christian Democrat (CDU) Angela Merkel by double digits Sascha Schuermann/Getty Images German election 2017 Sahra Wagenknecht, top candidate of the left-wing Die Linke party for upcoming general elections, gives a speech during a session at the Bundestag (lower house of parliament) in Berlin on September 5 John MacDougall/AFP German election 2017 Top candidate for the Greens for the 2017 German federal elections, Cem Ozdemir, speaks during an election campaign rally of the Alliance '90/Greens in Stuttgart, southern Germany on September 20, 2017, during the final days before Germans head to the polls Thomas Kienzle/AFP German election 2017 Leader of the Free Democrats (FDP) and main candidate in the upcoming parliamentary elections, Christian Lindner gives a speech during the party congress in Berlin on September 17 Odd Andersen/AFP German election 2017 Alice Weidel and Alexander Gauland, co-lead candidates of the right-wing, populist Alternative for Germany (AfD) political party, speaking to the media on Islam, immigration and crime next to an AfD poster that reads: 'Crime Through Immigration, The Refugee Wave Leaves Behind Clues!' on September 18, in Berlin Tobias Schwarz/AFP German election 2017 People listen to German Chancellor and Christian Democrat (CDU) Angela Merkel speak at an election campaign stop on September 19, 2017 in Schwerin Getty German election 2017 Refugees from Syria prior to the arrival of German Chancellor and Christian Democrat (CDU) Angela Merkel at an election campaign stop on September 19, 2017 in Schwerin Sean Gallup/Getty Images German election 2017 The audience cheers whilst listening to German Social Democrat (SPD) and chancellor candidate Martin Schulz speaking during an election campaign stop on September 14 in Munich Joerg Koch/Getty Images German election 2017 German Chancellor Angela Merkel holds up a tomato as she addresses an election campaign rally of the Christian Democratic Union (CDU) in Lingen on September 13 AFP/Getty Images German election 2017 Alexander Gauland, top candidate of Germany's anti-Islam, anti-immigration AfD (Alternative fuer Deutschland) party for upcoming general elections, walks past supporters as he attends an election campaign event in Nuremberg Daniel Karmann/AFP German election 2017 British politician and former UKIP leader Nigel Farage speaks at an event held by the German right-wing, populist Alternative for Germany (AfD) political party as AfD leading member Beatrix von Storch looks on on September 8, 2017 in Berlin Sean Gallup/Getty Images German election 2017 Martin Schulz (C), chancellor candidate of the German Social Democrats (SPD), looks on in a fest tent at the Gillamoos amusement fair on September 4, 2017 in Abensberg, Germany. Politicians, among them elections candidates, from Germany's major political parties are attending the fair today in what is an an annual tradition Johannes Simon/Getty Images German election 2017 An Alternative for Germany (AfD) campaign poster is vandalised in Berlin. Germans go to the polls on September 24th, with the AfD widely expected to garner enough votes to enter the federal parliament. Campaign poster reads: 'New Germans? we'll make them ourselves.' AFP

The AfD was founded in 2013 as an anti-euro party, when it won 4.7 per cent of the vote in that year’s federal elections, narrowly missing the 5 per cent threshold for winning seats in the Bundestag. It has since taken a more explicitly anti-immigration and anti-Islam stance and seen its popularity grow – pledging to ban mosques, minarets and face veils. The party says it wants to take Angela Merkel to court for accepting refugees and campaigned under the explicit slogan “Islam is not a part of Germany”.

The party previously sat in the same European Parliament group as the British Conservative Party – the European Conservatives and Reformists (ECR) – but it was expelled after signing a cooperation agreement with the Austrian Freedom Party, a far-right populist outfit.

Early seat projections suggest that the CDU will hold 218 MPs in the coming session of the Bundestag, and the SPD 138.