By Sanjoy Majumder
BBC News, Delhi
Mr Singh says the deal is essential for India's future
In the end, it was a relatively comfortable win for the Indian government.
In particular, it was a decisive victory for Prime Minister Manmohan Singh, who had staked his personal reputation on the Indo-US nuclear agreement, a deal that many in his own party were not convinced about.
With general elections due in less than a year, there were some who questioned the merits of backing a deal that many Indians did not understand or simply did not care about.
One member of parliament was quoted as saying that he was voting against the government because he found the deal "too complicated to fathom".
But Mr Singh was convinced that it was an agreement in India's best interests, and was clearly even willing to risk the future of his government.
Next stop - general election
For the past few days, the vote had looked too close to call. Governing and opposition party leaders had gone all out to secure the votes of smaller parties and independents.
Mayawati has emerged as a potential future prime minister
And while the government had been forced to seek the vote after losing the support of its left-wing allies who opposed the nuclear deal, they also had to contend with an equally combative opposition.
Sensing that the government was vulnerable, the main opposition Bharatiya Janata Party (BJP) pulled out all the stops. The government, it said repeatedly, was panicking and using every means, fair and foul, to secure a victory.
But the surprise came from a powerful regional politician who emerged as a rallying point for many of the smaller parties - Mayawati, a low-caste politician and chief minister of Uttar Pradesh, India's most politically influential state.
With the support of left-wing and other regional parties, she began persuading some members of the governing coalition to vote against it.
It was a tactic that almost worked. And it also pitched her on to the centre-stage of Indian politics. Already she is being talked of as a potential candidate for prime minister after the next elections.
In effect, the confidence vote debate has set the scene for those polls.
While the nuclear deal was the central issue on the floor of parliament's lower house, it was fairly evident that most parties used the opportunity to kick off their campaign.
Many members believe that it is economic issues such as rising prices which voters will be most concerned about rather than the nuclear question.
And so over the past week, political parties have been jockeying to be in prime position when the elections are eventually held. New alliances have been forged, old enemies have become new friends.
But if there is one thing that has dismayed most Indians over the past 48 hours, it is the sight of their political leaders openly squabbling in parliament.
Even by Indian standards this was an unruly, ugly debate that often threatened to get out of hand.
Allegations of bribery aside, there were demands from the bizarre to the ridiculous. The leader of one small party, with all of three parliamentary members, managed to get an international airport named after his father.
Six jailed MPs, some serving life sentences for crimes as serious as murder, were given bail so that they could vote in parliament. Under Indian law, they may continue to hold their position until the last of their appeals is dismissed.
It was a sordid, seamy side of the world's largest democracy laid bare.