India has electrified all its villages 12 days ahead of a deadline set by Prime Minister Narendra Modi, the government said on Sunday, which could give the ruling party a boost ahead of a general election in 2019.

Asia's third-largest economy has been held back for years by a power shortage, with industries having to cope with blackouts and hospitals forced to rely on diesel-run generators for backup.

But Modi said on Sunday that April 28, on the evening of which a remote village in the northeast became the last to be connected to the grid, would be remembered as a "historic day in the development journey of India".

"Yesterday, we fulfilled a commitment due to which the lives of several Indians will be transformed forever!" Modi wrote on Twitter, as various ministers in his government took to social media to congratulate him.

Power Minister Piyush Goyal wrote on Twitter: “Under the decisive leadership of PM @NarendraModi India has finally been able to electrify all its villages before the set target date. With the elimination of darkness from the lives of fellow Indian villagers, we commit ourselves to building a new and #PowerfulIndia.”

But what’s the parameter to check if a village is electrified?

According to the Government site data.gov.in a village would be declared as electrified if:

1) Basic infrastructure such as Distribution Transformer and Distribution lines are provided in the inhabited locality as well as the Dalit Basti/ hamlet where it exists. (For electrification through Non Conventional Energy Sources a Distribution transformer may not be necessary).

2) Electricity is provided to public places like Schools, Panchayat Office, Health Centres, Dispensaries, Community centers, etc. and

3) the number of households electrified should be at least 10% of the total number of households in the village. The data contains details on the progress made towards village electrification for the month. The detail includes the cumulative achievement, percentage of villages electrified along with the number of unelectrified villages.

Government data showed that all of India's 597,464 census villages have now been electrified. When Modi took office in 2014, there were some 18,452 villages without electricity.

But just because all villages are connected to the grid does not mean all Indians have access to power.

The government considers a village electrified if it has basic electrical infrastructure and 10 percent of its households and public places including schools, local administrative offices and health centres have power.

The World Bank said in a report last year that globally 1.06 billion people had no electricity, with India and Nigeria topping the list of most power-deficient countries.

Last year, PM Modi had said that no village in the country will be without electricity by 2018.

"India has in the last three years improved on all macro-economic indicators. India must be an engine of growth as well as an example in climate friendly development in the years to come," the Prime Minister had said during annual meeting of the African Development Bank (AfDB) in Gujarat's Gandhinagar.

According to a 2016 report, the Centre had decided to provide power to 18,452 villages by May 1, 2018.

With inputs from Reuters