The US Congress has approved a bill authorising the Pentagon to spend $160bn (£104bn) in Iraq and Afghanistan during this budget year.
A previous version was rejected because it included several controversial measures, including one to allow gays to serve openly in the military.
But President Barack Obama has now signed separate legislation overturning the "don't ask, don't tell" policy.
He must now sign the defence bill after it passed both houses of Congress.
"The controversial aspects of this legislation have been removed," said Republican Senator John McCain of Arizona.
The House of Representatives originally approved the measure on Friday of last week, but lawmakers in the House were forced to review it again after the Senate removed a provision involving the payment of World War II claims to residents in Guam.
The payments were dropped because some senators objected to the cost of the claims, said Madeleine Bordallo, a Democratic delegate from Guam.
The bill is especially important to lawmakers in Congress because it allows them to have a degree of control in operations at the Pentagon by authorising spending levels.
Guantanamo Bay link
This year's bill, which received largely bipartisan support in Congress, agreed to $725bn in defence proposals, including $158.7bn for combat operations in Iraq and Afghanistan.
If approved by the president, the measure would continue to restrict the Pentagon's ability to close the Guantanamo Bay detention camp as well as prohibit the transfer of detainees to the US.
The legislation would also raise the pay of troops by 1.4% and allow the children of members of the military to stay covered under the military's health care until they are 26-years-old.
Other provisions in the legislation include:
- $75m (£49m)to train and supply weapons to Yemeni counter-terrorism forces
- $205m for a programme with Israel to develop a mobile defence system
- $11.6bn toward the development of security in Afghanistan
- $1.5bn to Iraqi security forces
In an atypical move, the measure was passed in the House with little debate on the war in Afghanistan.
Congress is also expected to vote on a new nuclear arms treaty between the US and Russia as well as a 9/11 healthcare bill before the end of the day on Wednesday.