President Barack Obama on Friday signed into law a massive defense policy bill that endorses his plan to fight Islamic State militants, including air strikes, training of Iraqis and moderate Syrian rebels.

The law authorizes funds for basic military operations, from a 1 percent pay raise for troops to the purchase of ships, aircraft and other war-fighting equipment.

It also authorizes the training and equipping of moderate Syrian rebels battling the extremists for two years and provides $5 billion to train Iraqis battling the militants who brutally rule large sections of the two countries.

The measure provides the core funding of $521.3 billion for the military and $63.7 billion for overseas operations in Afghanistan and Iraq. Despite Obama's objections, it maintains a ban on transferring terror suspects from the Guantanamo Bay detention center in Cuba to the United States for prosecution or imprisonment.

The Pentagon sought cuts in military benefits. Lawmakers compromised by agreeing to make service members pay $3 more for co-pays on prescription drugs and trimming the growth of the off-base housing allowance by 1 percent instead of the Pentagon's deeper 5 percent recommendation.

The law also prohibits retirement of the A-10 Warthog, the close-air support plane often described as ugly but invaluable.

The law changes the way the military justice system deals with sexual assault cases, including scrapping the nearly century-old practice of using a "good soldier defense" to raise doubts that a crime has been committed. The measure gives accusers a greater say in whether their cases are litigated in the military or civilian court system, and would establish a confidential process to allow victims to challenge their separation or discharge from the military.

It also makes victims of the November 2009 attack at Fort Hood, Texas, eligible to receive the Purple Heart. Thirteen people were killed and more than 30 wounded by Army psychiatrist Nidal Hasan, who has said he was angry about being deployed to Afghanistan and wanted to protect Islamic and Taliban leaders from U.S. troops.