The conflict began when the city of Danzig, along with the Polish episcopate and a portion of the Polish szlachta, did not recognize the royal election of Bathory to the Commonwealth throne and instead supported the candidature of Emperor Maximilian.