The anticipated outcome was announced by Lok Sabha Secretary General T.K. Viswanathan, the returning officer for the poll, minutes after the counting of votes ended Tuesday evening.
Ansari, 75, polled 490 first preference votes out of 728 valid votes cast in the election held earlier in the day. Jaswant Singh polled 238 votes.
Viswanathan said that 787 members from the two houses were eligible to cast vote, and 736 exercised their franchise. Eight votes were found invalid.
He said that Ansari needed 365 votes to be declared elected.
“Therefore, Mohammad Hamid Ansari is duly elected as Vice President of India,” Viswanathan said.
Jaswant Singh, a Bharatiya Janata Party MP and a former union minister, said the result was not disheartening for the National Democratic Alliance (NDA), which the BJP leads.
“The NDA was united. We got other votes also. There is place for satisfaction and not for despair,” he said.
Sounding graceful in defeat, Jaswant Singh said he had called up Ansari to congratulate him and had extended all his cooperation.
Ansari, who as the Vice-President is also Rajya Sabha chairman, was given certificate of election by Viswanathan.
Soon after he was declared elected, Ansari was greeted by Prime Minister Manmohan Singh and Congress president Sonia Gandhi.
Ansari said he was delighted with the results and expressed his gratitude to MPs for giving him support.
“Core agenda of the chair is determined by the house. I am confident that we would have cooperative approach to work entrusted to Rajya Sabha,” he said.
Ansari, who has served as the country’s Vice-President since 2007, is a distinguished scholar and a seasoned diplomat. A former ambassador to the United Arab Emirates, Afghanistan, Iran and Saudi Arabia, Ansari also worked as vice-chancellor of Aligarh Muslim University and chairman of the National Minorities Commission.
Congress leaders had hoped Ansari would get over 500 votes.
Ansari was also in contention as the United Progressive Alliance’s (UPA) presidential candidate before Pranab Mukherjee was chosen as the nominee.
Ansari’s victory in Tuesday’s poll comes two weeks after Mukherjee won comfortably in the presidential election.
Observers feel that presidential and vice-presidential elections have provided the Congress an opportunity to improve its ties with its allies in the UPA and forge better understanding with outside supporters of the government.
Ansari got more votes than he had secured in the 2007 election. He had the backing by the Congress and its allies in the UPA, including the Nationalist Congress Party, DMK and the National Conference. The Trinamool Congress, which had not announced its decision, also later indicated it would support Ansari.
Outside supporters of the UPA, including the Samajawdi Party, Rashtriya Janata Dal and Bahujan Samaj Party, had also indicated their preference for Ansari. Several of the Left parties also lent him their support.
On the other hand, Jaswant Singh was backed by the NDA as well as the AIADMK.
Cine star Rekha and cricket icon Sachin Tendulkar, who are nominated members of the Rajya Sabha, were among the MPs who cast their vote in the vice-presidential election.
The result of vice-presidential poll came a day before the start of the monsoon session of Parliament.