NEW DELHI — General elections in India will begin on April 11, officials announced on Sunday, with some 900 million voters eligible to cast ballots to fill parliamentary seats and choose the next prime minister in the world’s largest democracy.

The elections, which will be held during a period of heightened nationalism in India, are a crucial test for the governing center-right Bharatiya Janata Party, or B.J.P., and for Prime Minister Narendra Modi, who is running for a second five-year term.

Many analysts say that Mr. Modi’s image — recently dented by slowing economic growth and allegations that the governing party had suppressed a report showing a 45-year high in unemployment — has recovered since a military confrontation between India and Pakistan, and has perhaps even strengthened ahead of the vote.