The 71-year-old Kovind defeated joint opposition candidate Meira Kumar, a former Lok Sabha speaker, after garnering 65.65 percent of the votes in the electoral college.
Expressing happiness over the "extensive" support Kovind got from the electoral college, Prime Minister Narendra Modi said, "Congratulations to Shri Ram Nath Kovind Ji on being elected the President of India! Best wishes for a fruitful & inspiring tenure."
A former Bihar governor, Kovind received 2930 votes with a value of 7,02,044, said election Returning Officer Anoop Mishra. Kumar got 1844 votes with a value of 3,67,314.
The winning margin was not as big as forecast by the BJP, which had projected a 70 per cent vote for Kovind. Outgoing President Pranab Mukherjee had received votes valued at 7,13,763.
"I never aspired to be the president. My win is a message to those discharging their duties with integrity. My election as the President is an evidence of the greatness of Indian democracy," Kovind told the media after his victory was announced. "I am feeling emotional."
Kovind is the first BJP member to be elected president. He will take oath of office on July 25 for a five-year term. He is also the second Dalit to occupy Rashtrapati Bhavan after K.R. Narayanan. Previous presidents have included a Sikh and two Muslims.
As soon as the results were formally announced, the sounds of firecrackers going off reverberated in Kalyanpur in Kanpur Dehat in Uttar Pradesh, where Kovind hails from.
The teachers of DAV College, where Kovind had studied, said they were proud of his achievement.
"For us it is indeed a glorious moment, as one of the proud alumnus of our college is now going to occupy the top constitutional post of the country," said Amit Kumar Srivastava, principal of the college.
Kovind's victory is partly due to the BJP's massive victory in the Uttar Pradesh assembly elections earlier this year. This gave the party a big boost in the electoral college numbers.
Even after the U.P. Victory, the BJP-led NDA was slightly short of majority and had to rely on the support of non-NDA parties such as TRS in Telangana, AIADMK factions and DMK in Tamil Nadu, the JD(U) in Bihar, and BJD in Odisha.
But the party played a masterstroke by fielding a Dalit candidate as part of its outreach to woo the backward communities, which several opposition parties found difficult to oppose given the political sensitivites. This forced the opposition to follow suit and put up Kumar, a diplomat- turned-politician, in a Dalit vs Dalit fight.
Congratulating her poll rival, Kumar said it has now fallen on Kovind to uphold the Constitution in letter and spirit in "these challenging times".
Kumar said that her fight for secularism, the oppressed and the marginalised will continue.
Modi also congratulated Kumar for her campaign, saying it was "in the spirit of democratic ethos and values we all are proud of".
Among those who congratulated Kovind were Congress President Sonia Gandhi, Lok Sabha Speaker Sumitra Mahajan, a host of chief ministers and other politician.
Soon after, the president-elect met with Modi, who put a piece of sweetmeat in his mouth after putting a stole around his neck, as BJP President Amit Shah looked on.
Hailing as "historic" Kovind's election, Shah said it is a "victory for the poor, downtrodden and marginalised and their aspirations".
A total of 768 out of 771 eligible MPs cast votes. Likewise, 4083 out of 4109 eligible MLAs cast their votes, registering a turnout of nearly 100 percent.
While 522 MPs voted for Kovind, Kumar secured support of 225 parliamentarians.
The electoral college comprises of Members of Parliament and members of legislative assemblies of all states.
While the value of an MLA's vote depends on the population of his or her state, the value of an MP's vote remains the same at 708.
The polling was marked by cross-voting in various states where many opposition members favoured Kovind.
The vice-presidential election will be held on August 5. While BJP has nominated a former party president, Venkaiah Naidu, the opposition has fielded former West Bengal governor Gopal Krishna Gandhi.