The AfD captured nearly 13 percent of the vote and almost 100 seats in parliament -- a watershed moment in German post-war politics that left Chancellor Angela Merkel the winner but required her to seek out a still-elusive coalition. However a row between radical nationalists and more moderate forces has festered in the AfD's top ranks, with co-leader Frauke Petry abruptly quitting just days after the election to form her own breakaway party.
Around 600 delegates gathered at the two-day congress in the northern city of Hanover to elect her replacement, setting up a dramatic showdown between the warring factions.
Jörg Meuthen, who belongs to the hard-right nativist wing, was re-elected as co-leader with an overwhelming 72 percent of the vote. But when the relatively moderate Berlin AfD chief Georg Pazderski failed in two ballots to win Petry's vacant seat, the party's powerful parliamentary group chief Alexander Gauland was recruited to stand.
"I wasn't seeking this," said Gauland, who won 68 percent of the vote. "But fate wanted it another way and so I allowed my friends to convince me to step in."
The choice of leaders confirmed the steady rightward march of the party, which was founded in 2013 as a populist anti-euro outfit. Before the vote, Meuthen said he was working out of "passion for Germany" and to confront "the threat of us losing our country -- maybe not immediately but little by little".
Outside, hundreds of demonstrators staged sit-ins to block roadways to the venue, delaying the start of the congress by nearly an hour.
After reporting minor scuffles with protesters, police deployed water cannon in frigid weather to remove some of the blockades. Several officers were injured in scuffles, one on the hand by a flying bottle, and a demonstrator who had chained himself to a barricade suffered a broken leg and was taken to hospital, police said.
Later Saturday more than 6,000 pro-refugee demonstrators marched through the city centre supporting Merkel's liberal border policy, which has allowed in more than one million asylum seekers since 2015.
Meuthen told cheering delegates at the start of the meeting that the AfD was Germany's "only party for patriotic policies" and accused Merkel of "fundamental political failure" during her 12 years in office.
The AfD is now represented in 14 of Germany's 16 state parliaments but has been shunned by mainstream parties as a potential partner at the national level.
A video shown at the start of the event celebrated the regional election victories and ended with the rallying cry "We want our homeland back."
Meuthen predicted the AfD would hold seats in all 16 states by the end of 2018.
The fractured political landscape has made it more difficult than ever for Merkel to cobble together a governing majority. Talks to form a coalition spanning the political spectrum for her fourth and probably last term broke down in acrimony last month. She is now trying to woo the centre-left Social Democrats back into a right-left "grand coalition" government.
If she is successful and averts a snap election, the AfD would become Germany's largest opposition power, strongly boosting its profile.
Deadlock 'good for us'
Delegates defeated a motion to have Meuthen as the AfD's sole president, wary of consolidating too much power in one person and hoping to bridge the internal divisions.
Gauland has resisted efforts by AfD moderates to groom the party for participation in coalition governments on the state or local level, saying it is too young to venture beyond the opposition.
It's all downhill for Merkel now and that is partly our achievement," Gauland told AFP in an interview ahead of the Hanover congress. "Her time is up -- we want her to leave the political stage."
Meuthen said the "pathetic little sandbox games" of the other parties leading to the political deadlock in Berlin were helping the AfD.
"It is good for us," he said to applause. "It brings us more supporters."
By AFP's Deborah Cole