During the First World War, Kramář was imprisoned for treason against Austria-Hungary but later released under an amnesty. In 1918, he headed the Czechoslovak National Committee in Prague, which declared independence on 28 October. Kramář became the first Prime Minister of the new state but resigned over policy differences less than a year later. Although he remained a member of the National Assembly until his death in 1937, his conservative nationalism was out of tune with the main political establishment, represented by the figures of Tomáš Garrigue Masaryk and Edvard Beneš.