The first Muslim woman has been elected as the speaker of a state parliament in Germany in what she hailed as a “historic” step for the country.

Muhterem Aras, a Green Party politician, took the post in Baden-Württemberg from a member of a populist anti-immigration party on Wednesday.

“We wrote history today,” she said after sweeping in with a significant majority.

Muhterem Aras is congratulated on being elected president of the Baden-Wuerttemberg state parliament on 11 May 2016. (EPA)

Ms Aras, 50, said her victory sent a message of “openness, tolerance and successful integration”, The Local reported.

Born in Turkey, she moved to a town near Stuttgart with her parents as a child and studied economics before founding her own tax advice firm.

Her political career started in 1992, standing for the Greens on the local council and rising through the local party to become its local leader and enter the Baden-Württemberg state parliament.

She was elected as “Landtagspräsident” by 96 local MPs, becoming the first Muslim woman to take the office.

The election came amid continuing tensions over religion, immigration and extremism in Germany, where a man reportedly shouting “Allahu Akbar” stabbed four people at a railway station on Tuesday.

In pictures: Knife attack at German railway station Show all 10 1 /10 In pictures: Knife attack at German railway station In pictures: Knife attack at German railway station Grafing attack Forensic investigators at the scene of a stabbing attack on a train at Grafing railway station near Munich, Germany, 10 May 2016. AP In pictures: Knife attack at German railway station Grafing attack Forensic investigators at the scene of a stabbing attack on a train at Grafing railway station near Munich, Germany, 10 May 2016. AFP/Getty Images In pictures: Knife attack at German railway station Grafing attack A policeman walks past flowers, placed at the stairs of a train station, following a knife attack in Grafing train station Reuters In pictures: Knife attack at German railway station Grafing attack Forensic investigators at the scene of a stabbing attack on a train at Grafing railway station near Munich, Germany, 10 May 2016. AP In pictures: Knife attack at German railway station Grafing attack Forensic investigators at the scene of a stabbing attack on a train at Grafing railway station near Munich, Germany, 10 May 2016. EPA In pictures: Knife attack at German railway station Grafing attack Forensic investigators at the scene of a stabbing attack on a train at Grafing railway station near Munich, Germany, 10 May 2016. AP In pictures: Knife attack at German railway station Grafing attack Two bicycles at the scene of a deadly knife attack at a railway station in Grafing, Bavaria, on 10 May 2016 EPA In pictures: Knife attack at German railway station Grafing attack Secured by forensic specialists of the German police a bicycle lays on the floor at the crime scene after a deadly knife attack in Grafing Getty Images In pictures: Knife attack at German railway station Grafing attack A forensic expert of the police is seen working in front of a bistro near the train station in Grafing Getty Images In pictures: Knife attack at German railway station Grafing attack A police officer takes pictures at the train station after an attack in Munich. One person has been killed and several injured after suspected Islamist stabbed passers-by at a railway station in Grafing Reuters

Members of the anti-immigration party Alternative for Germany (AfD) refused to join the applause during Ms Aras’ first session as speaker, the Süddeutsche Zeitung reported.

Earlier this month, the party enjoyed record success in local elections on a manifesto that claimed Islam was not compatible with the country’s constitution and called for a ban on minarets and the burqa.

A poll released on Thursday indicated that almost two-thirds of Germans think Islam does not “belong” to their country.

The survey results indicated changing attitudes following the Paris and Brussels attacks and the arrival of more than a 1.1 million refugees in the country.

Around 60 per cent of the 1,003 respondents said the religion had no place in Germany, while 34 per cent said it did.

