Indian Prime Minister Narendra Modi's Hindu nationalist party has ended Congress party rule in a key southern state, a victory that will boost morale with national elections less than a year away.

The Bharatiya Janata Party's B.S. Yeddyurappa was sworn in as Karnataka state's top elected official on Thursday. The BJP has been riding a wave of rising Hindu nationalism in the country since Modi won elections in 2014.

The Congress party has now been reduced to governing only one key state, Punjab, out of 29 states in the country.

The latest vote was a major setback for Rahul Gandhi, the 47-year-old heir to India's Nehru-Gandhi political dynasty, who took over as Congress party president from his mother in December.