Political history has been made in India as the country welcomes its first tribal woman president.
Droupadi Murmu, 64, a Santhal — a marginal tribal community — crossed the crucial halfway mark in the election after three rounds of counting that began on Thursday afternoon.
Ms Murmu had received 64 per cent of votes against Yashwant Sinha's 36 per cent.
The counting for the final batch of votes was under way late on Thursday.
Ms Murmu is from Mayurbhanj in eastern Odisha state and is a long-time member of the Hindu nationalist Bharatiya Janata Party.
She will replace incumbent President Ramnath Kovind, a member of the marginalised Dalit community.
The oath-taking ceremony will take place on July 25.
Prime Minister Narendra Modi visited Ms Murmu on Thursday to personally congratulate her.
“India scripts history,” Mr Modi wrote on Twitter. "At a time when 1.3 billion Indians are marking Azadi Ka Amrit Mahotsav, a daughter of India hailing from a tribal community born in a remote part of eastern India has been elected our President."
Mr Modi’s BJP had fielded Ms Murmu for the top post while a joint opposition had backed Yashwant Sinha, an 84-year-old bureaucrat-turned-politician.
“India hopes that as the 15th President of the Republic she functions as the Custodian of the Constitution without fear or favour,” Mr Sinha wrote on Twitter.
TV footage showed people from her community celebrating the victory of a “tribal woman” outside BJP headquarters in capital Delhi.
At her residence in Mayurbhanj, her younger brother Tarinisen Tudu handed out sweets and said he was "overjoyed".
More than 4,800 legislators and parliamentarians cast their votes on Monday to choose between Ms Murmu and Mr Sinha for the nation's top constitutional job.
At least 107 opposition politicians cross-voted for Ms Murmu.
India's president is a ceremonial head of the country with no real powers and acts mostly on the advice of the government.
But a successful election presents political parties with the opportunity to showcase their nationwide political strength, as well as their symbolism.
Political parties routinely back candidates from marginalised groups such as Dalits — formerly known as untouchables — and are from the lowest rung in the Hindu caste hierarchy, women and religious minorities.
Ms Murmu has spent nearly two decades in politics and social service. She was previously appointed the first tribal governor of Jharkhand state in 2015.