Passage: Gandhi's arrest lasted two years, as he was held in the Aga Khan Palace in Pune. During this period, his long time secretary Mahadev Desai died of a heart attack, his wife Kasturba died after 18 months' imprisonment on 22 February 1944; and Gandhi suffered a severe malaria attack. While in jail, he agreed to an interview with Stuart Gelder, a British journalist. Gelder then composed and released an interview summary, cabled it to the mainstream press, that announced sudden concessions Gandhi was willing to make, comments that shocked his countrymen, the Congress workers and even Gandhi. The latter two claimed that it distorted what Gandhi actually said on a range of topics and falsely repudiated the Quit India movement.Gandhi was released before the end of the war on 6 May 1944 because of his failing health and necessary surgery; the Raj did not want him to die in prison and enrage the nation. He came out of detention to an altered political scene – the Muslim League for example, which a few years earlier had appeared marginal, "now occupied the centre of the political stage" and the topic of Muhammad Ali Jinnah's campaign for Pakistan was a major talking point. Gandhi and Jinnah had extensive correspondence and the two men met several times over a period of two weeks in September 1944, where Gandhi insisted on a united religiously plural and independent India which included Muslims and non-Muslims of the Indian subcontinent coexisting. Jinnah rejected this proposal and insisted instead for partitioning the subcontinent on religious lines to create a separate Muslim India (later Pakistan). These discussions continued through 1947.While the leaders of Congress languished in jail, the other parties supported the war and gained organizational strength. Underground publications flailed at the ruthless suppression of Congress, but it had little control over events. At the end of the war, the British gave clear indications that power would be transferred to Indian hands. At this point Gandhi called off the...

Question: How many years did Gandhi spend in prison?
two