WASHINGTON (Reuters) - U.S. Senate Democrats defeated a Republican effort to undercut the Iran nuclear agreement on Wednesday by blocking an amendment to a spending bill that would have stopped the Obama administration from buying heavy water from Tehran. The amendment to an energy spending bill offered by Republican Senator Tom Cotton received 57 yes votes and 42 no votes. It had needed 60 yes votes to advance in the 100-member Senate. Cotton withdrew his amendment after the vote and the Senate is expected to vote later on a version of the spending bill without it. The measure would have barred the use of U.S. government funds to purchase heavy water, which is non-radioactive and used in nuclear reactors and for making nuclear weapons. Under last year’s nuclear deal between Iran, the United States and five other world powers, Tehran is responsible for reducing its stock of the substance, which it can sell, dilute or dispose of, under certain conditions.  President Barack Obama’s administration had warned Congress that it strongly opposed any move to prevent the planned purchase of $8.6 million-worth of heavy water from Iran. Senate Democrats and a handful of Republicans had also banded together in late April to block the Cotton amendment, and hence the spending bill. The dust-up had put a crimp in Senate Majority Leader Mitch McConnell’s plans to pass bipartisan appropriations bills to keep the federal government functioning beyond Sept. 30, the end of the government’s fiscal year. 