New Delhi: The grandson of India's independence leader Mahatma Gandhi has dropped out of the race to become president after his name was proposed by an alliance of opposition parties.

Gopalkrishna Gandhi, 77, a diplomat turned politician said he had declined the request of the 17-party alliance to be their nominee for the largely ceremonial role.

"I am most grateful to them. But having considered the matter deeply I see that the Opposition's candidate should be one who will generate a national consensus and a national atmosphere beside Opposition unity," Gandhi said in a statement on Monday.

National and state lawmakers are slated to vote on a new president on July 18.

The Indian head of state enjoys certain constitutional powers but largely acts on the advice of the government, making it more of a titular position.

But agreeing on a candidate and getting him or her elected would be a symbolic victory for India's splintered opposition after eight years of rule by Prime Minister Narendra Modi's Bharatiya Janata Party (BJP).

The BJP is likely to announce its own candidate this week and may again put forward the incumbent, Ram Nath Kovind, a member of India's marginalised Dalit community, to serve another term.

Gandhi, who was governor of West Bengal state between 2004 and 2009 after being appointed by the then-ruling Congress party, ran for vice-president in 2017 but lost out to a BJP candidate.

The paternal grandson of India's freedom movement icon is considered a vocal critic of Modi's Hindu nationalist policies and has accused the government of crushing dissent in the world's largest democracy.

Gandhi is the third person to decline an offer by the opposition to be their candidate.

The Gandhi dynasty of assassinated former prime ministers Indira and Rajiv Gandhi, and of current opposition figure Rahul Gandhi, are descended from India's first premier Jawaharlal Nehru and not from Mahatma Gandhi.