BERLIN — An upstart German nationalist party has gone from ousting its leader amid bitter infighting just over a year ago to reveling in newfound success.

The Alternative for Germany party’s ratings were as low as 4 percent just 14 months ago. But the party has since tapped into anger over Chancellor Angela Merkel’s migrant policies and become a thorn in the side of all of the country’s established parties.

Known by its German acronym AfD, the party was founded in 2013 as a group focused on opposing Merkel’s eurozone rescue policies. Opposition to immigration and Islam have taken center stage since Frauke Petry ousted co-founder Bernd Lucke, an economics professor who dominated its early public profile, to become its best-known face in July last year.

Much remains unclear, though, about the party’s long-term strength, aims and leadership.

AfD now polls between 11 and 14 percent nationally, and won over 20 percent of votes in two state elections this year in the ex-communist east. It overtook Merkel’s conservative Christian Democrats to finish second last weekend in Mecklenburg-Western Pomerania, where the chancellor has her parliamentary constituency.

Merkel told the national parliament this week that it is “a challenge for us all.”

AfD in May approved a policy platform which declares that “Islam is not part of Germany,” opposes “unregulated asylum immigration” and rejects Turkish membership in the European Union. It opposes planned free-trade agreements with the U.S. and Canada and urges more direct democracy, including national referendums.

In other areas, AfD embraces policies abandoned by Merkel’s conservatives. It advocates the return of military conscription and extending the life of nuclear power stations.

All of its top personalities have courted controversy at times — Petry, for example, by suggesting earlier this year that police could shoot migrants trying to enter Germany, and deputy leader Alexander Gauland by reportedly saying that many people wouldn’t want a key player on Germany’s national soccer team, who is black, as their neighbor.

Public infighting soon resurfaced after last year’s split, with at least four figures vying for influence at the top. For now at least, voters don’t appear to care.

AfD suffers from “personal incompatibilities of the kind there always are in a young party,” Gauland said recently. “But I don’t think they are at all relevant for the party’s success, because they don’t involve real political differences.”

AfD’s fortunes picked up after Merkel allowed in a surge of migrants last September. Gauland said “the chancellor’s wrong refugee policy was a piece of luck for the party.”

In Mecklenburg, a region with few foreigners but scant resources and high unemployment, AfD took voters from almost all of what it calls contemptuously “the old parties.” Those rivals range from the Left Party, a descendant of East Germany’s communists and once a favorite with protest voters, to Merkel’s conservatives.

Its success also eliminated the far-right National Democratic Party from its last state legislature, while many previous non-voters turned out for AfD.

AfD is keen to dismiss suggestions it’s a one-issue party as it looks to enter Germany’s national Parliament in an election expected next September. Petry said this week it will campaign on “the euro crisis, the question of how we deal with Europe and the EU, how do we solve the problems that result from undirected illegal migration regarding family policy, regarding domestic security.”

Whether it will have a single lead candidate, and who that might be, remains unclear. And its political profile is complicated by constant jostling at the top.

Petry, the most prominent leader, has described her political style as “constructive with an occasional penchant for provocation.”

That’s a sharp contrast with the consensual approach of the chancellor, who said at a recent campaign appearance: “There are people who are good at provoking, but that doesn’t achieve anything for the country.”

Petry, a 41-year-old businesswoman and mother of four born in the eastern city of Dresden, studied chemistry in England and Germany and was a newcomer to politics when she became one of AfD’s founding leaders in 2013. She shares with the 62-year-old Merkel a childhood in the ex-communist east, a background in science and a late entry to politics — but little else.

Petry vies for influence with co-chairman Joerg Meuthen, Gauland and Bjoern Hoecke, a prominent figure on the party’s hard right. All four have regional power bases, leading parliamentary groups in states where AfD has won seats.

Senior figures also sound different notes on whether AfD aims for all-out opposition or an eventual government role. Meuthen said Monday that “we want to govern in the long term in this country — and we will head down that road persistently, unflinchingly and step by step.”

Gauland, however, said that in Germany’s coalition-based system it would be impossible for AfD to go into government with anything short of a near-absolute majority.

“There are four leadership figures who are fighting each other bitterly … that’s a bit much for such a small party,” said Hajo Funke, a political science professor at Berlin’s Free University. While they present themselves as moderate, AfD has a “radical center that is pushing the party before it,” he added.

Funke said that, because it lacks a leadership figure like Joerg Haider, who led Austria’s Freedom Party to success, he doesn’t see AfD coming close to the success of populist parties in Austria, France or the Netherlands.

It can expect support of “10 to 12 percent, if things stay the way they are, perhaps a bit less,” he said.