WASHINGTON — 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 and training 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.

Obama issued a separate statement criticizing the ban on Guantanamo transfers in the defense bill and the government funding bill he signed earlier this week. Obama declared at the outset of his presidency that he wanted to close the detention center, but Congress has thwarted his efforts.

"I have consistently opposed these restrictions and will continue to work with the Congress to remove them," Obama said. "The Guantanamo detention facility's continued operation undermines our national security. We must close it."

House Speaker John Boehner, R-Ohio, highlighted the ban on Guantanamo transfers. He said bringing terror suspects to the U.S. "would be both dangerous and deeply unpopular" with Americans.

"House Republicans will continue to do all we can to protect our national security and support our men and women in uniform, and look forward to working with the president to do the same," he said.

The Pentagon sought cuts in military benefits. Lawmakers compromised in the bill 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.