Swedish lawmakers have ousted Prime Minister Stefan Lofven in a mandatory confidence vote.

Tuesday’s vote comes in the aftermath of the September 9 parliamentary elections, when the anti-immigration Sweden Democrats won 62 seats, with the ruling center-left Social Democrats winning 144 seats and the center-right Alliance coalition 143 seats, creating a hung parliament.

The Social Democrats and the Alliance have both ruled out joining forces with the Swedish Democrats to form a ruling coalition. Lofven will remain prime minister in a caretaker role until a new government is formed.

Sweden, like most of Europe, has been hit by an influx of asylum seekers, who are fleeing from the Middle East, South Asia and Africa. The rising tide of immigrants has polarized voters and fractured a once cozy political consensus.