BERLIN — A nationalist, anti-migration party powered into three German state legislatures in elections Sunday held amid divisions over Chancellor Angela Merkel's liberal approach to the refugee crisis.

The elections in Baden-Wuerttemberg, Rhineland-Palatinate and Saxony-Anhalt were the first major political test since Germany registered nearly 1.1 million asylum seekers last year.

The 3-year-old Alternative for Germany, or AfD, easily entered all three legislatures. AfD won 15.1 percent of the vote in Baden-Wuerttemberg and 12.6 percent in Rhineland-Palatinate, official results showed. It finished second in Saxony-Anhalt with some 24 percent, according to projections.

There were uncomfortable results for Germany's biggest parties — Merkel's conservative Christian Democratic Union and the center-left Social Democrats.

The CDU kept its status as strongest party in Saxony-Anhalt. It had hoped to beat left-leaning Green Party Gov. Winfried Kretschmann in Baden-Wuerttemberg. It also hoped to oust Social Democrat Gov. Malu Dreyer in Rhineland-Palatinate.

But the CDU finished several percentage points behind the popular incumbents' parties and dropped 12 percentage points to a record-low result in Baden-Wuerttemberg, with 27 percent support. Its performance in Rhineland-Palatinate, with 31.8 percent, was also a record low.

The Social Democrats suffered large losses in Baden-Wuerttemberg and Saxony-Anhalt, where they were the junior partners in the outgoing governments, finishing behind AfD.

In all three states, the results were set to leave the outgoing coalition governments without a majority — forcing regional leaders into what could be time-consuming negotiations with new, unusual partners.