 Both Hungary and Bohemia were elective monarchies, where the parliaments had the sovereign right to decide about the person of the king.Therefore, after the death of his brother-in-law Louis II, King of Bohemia and of Hungary, at the battle of Mohács on 29 August 1526, Ferdinand immediately applied to the parliaments of Hungary and Bohemia to participate as a candidate in the king elections.On 24 October 1526 the Bohemian Diet, acting under the influence of chancellor Adam of Hradce, elected Ferdinand King of Bohemia under conditions of confirming traditional privileges of the estates and also moving the Habsburg court to Prague.