Nehru served as prime minister for 18 years, first as the interim prime minister and from 1950 as the prime minister of the republic of India.