US President Barack Obama signed into law a wide ranging defense bill, including about $633 billion in spending and beefed up sanctions on Iran late Wednesday night.

The bill was approved by the House and Senate by a wide majority in late December. Obama signed the spending legislation along with a bill staving off the much-feared ‘fiscal cliff,’ which would have raised taxes.

The defense package includes stringent new sanctions on Iran’s energy and shipping sectors in a fresh attempt to hobble the Islamic Republic’s economy and hamper its nuclear ambitions.

The sanctions build upon penalties that Congress has passed — and Obama has implemented — that target Tehran’s financial and energy sectors.

Officials in Washington argue that the sanctions have undermined Tehran’s economy and robust oil sales, thwarting its suspected pursuit of a nuclear weapon. Iran insists its nuclear program is for peaceful purposes.

Democratic Sen. Bob Menendez and Republican Sen. Mark Kirk, who have shepherded sanctions bills through Congress, sponsored the latest package that also would close a major loophole — the ability of Iran to circumvent sanctions and barter oil for precious metals. Turkey has been bartering gold for oil.

The sanctions would designate Iran’s energy, port, shipping and ship-building sectors as “entities of proliferation” and prohibit transactions with these areas. The legislation also would penalize individuals selling or supplying commodities such as graphite, aluminum and steel to Iran, all products that are crucial to Tehran’s ship-building and nuclear operations.

The bill would also provide some $526 billion for the base defense budget, $17 billion for defense programs in the Energy Department and about $88 billion for the war in Afghanistan.

Obama had threatened to veto the measure because of a number of concerns, including limits on his authority to transfer terrorist suspects from the US military prison at Guantanamo Bay, Cuba, for one year.

But Obama said that although he continued to oppose certain sections of the bill, “the need to renew critical defense authorities and funding was too great to ignore.”

The bill includes cuts in defense spending that the president and congressional Republicans agreed to in August 2011, along with the end of the war in Iraq and the drawdown of American forces in Afghanistan.

The measure also appropriates money for increased security at US diplomatic missions worldwide, int he wake of the deadly attack on the consulate in Benghazi, Libya.

Obama flew to Honolulu to continue his vacation with his family immediately after signing the bills. He had cut his holiday short to deal with fiscal cliff crisis late last week.