From Imperial Twilight: The Opium War and the End of China’s Last Golden Age, by Stephen R. Platt (Knopf, 2018), Kindle pp. 405-407:
The motion finally came to a vote at four o’clock in the morning of April 10  after three grueling nights of debate. Five hundred and thirty-three weary parliamentarians filed out into the division lobbies, and when their votes were tallied, it turned out that Palmerston had prevailed by the slimmest of margins. A majority of just nine votes—271 to 262—allowed Melbourne’s government to escape censure and effectively gave Palmerston’s war in China a sanction to proceed as planned. The outcome was so close that if the very cabinet ministers whose conduct was on trial had not been permitted to vote in their own favor, the motion to condemn them would have passed. For that reason it had been said that if the majority were fewer than ten votes, Palmerston and the other ministers would still agree to resign. It was, but they did not.
It is impossible to measure exactly how much influence George Staunton had on that outcome, but at least seven or eight of the Whig lawmakers had openly expressed their willingness to defy their party and oppose the China war if the debate should convince them it was morally unjust. If Staunton had declined to support Palmerston, or even had spoken against him, it would have taken just five of those waverers to change their votes and the entire outcome would have been reversed. James Graham’s resolution of censure would have passed, Melbourne’s government would have been brought down, and the Opium War might have been prevented.
An angry opposition press hunted for parties to blame. Some faulted Graham for couching his resolution in such political language of “negligence” rather than targeting the war head-on: if the Conservatives had “proposed to stop the war at all events, and to prevent every infraction of the laws of China with respect to opium—so surely would Parliament have gone along with them, in censuring the conduct of the Ministers,” said the Spectator. Another paper observed that though the ministry survived the vote of censure (barely), nevertheless “they are condemned by two hundred and sixty-two of the people’s representatives, and by the nation at large the principle of the war is all but universally condemned.” A majority of just nine votes out of more than five hundred “would have been fatal to the existence of any preceding Administration,” said one critic, “and it argues a contempt of the opinion of Parliament, and a degree of assurance never equalled, to persevere in plunging the country into war on the strength of such a vote.”
Any lingering hopes that the closeness of the vote in the House of Commons might still derail the war were destroyed a month later with the failure in the House of Lords of a much more explicit motion to blame the crisis on British opium traders. Palmerston’s Conservative antagonists had a clear majority in the upper house, and the motion was expected to pass until the elderly Duke of Wellington—the general who had defeated Napoleon at Waterloo, Britain’s greatest living military hero, a former prime minister, and a Conservative—broke with his party to deliver an adamantly pro-Palmerston speech that silenced the motion’s supporters and sent it to a quick death.
Wellington said he had looked into the cause of the war and was positive that “it could not be opium.” The lanky, seventy-one-year-old “Iron Duke” argued that it was entirely about the protection of British lives in the far corners of the world, an unquestionably fair use of military power. The dispatch of a naval fleet was the only fitting and just response, he believed, to the rash and violent actions of Lin Zexu against Elliot and the British merchants.