Beer hall owner Friedrich Steinberg said earlier this week that he wanted to cancel a planned appearance by AfD leader Frauke Petry, explaining that he was worried about damage to his reputation and possible violent protests.
But judges at the Munich state court have now decided that he didn't have a good enough reason to break the contract he had signed with the populist party.
"We've received [the injunction] from the court and are now examining legal options," Steinberg said after the ruling was handed down on Thursday.
"We're very disappointed that the judges don't see our security concerns."
Meanwhile, the head of AfD's Bavaria branch Petr Bystron called the decision a "resounding cuff around the ear for the Social Democratic Party (SPD) and Christian Democratic Union (CDU)."
Both mainstream parties had repeatedly attempted to block AfD events, Bystron said.
The Hofbräukeller enjoys some fame thanks to its connection with Adolf Hitler, who gave his first speech as leader of the German Workers' Party (DAP) – which later became the Nazi party – in the beer hall.