After the death of Jawaharlal Nehru, he was a strong contender for the post of Prime Minister, but his austere and autocratic style made him too many enemies within the Congress Party. In 1977 he was the obvious candidate to lead the Janata opposition to Mrs Gandhi and led his party to victory in the election of that year. As Prime Minister (1977–79) his inflexible style handicapped him in dealing with the economic and factional problems which confronted him and he resigned in 1979.