HONOLULU — President Obama, after objecting to provisions of a military spending bill that would have forced him to try terrorism suspects in military courts and impose strict sanctions on Iran’s oil exports, signed the bill on Saturday.

He said that although he did not support all of it, changes made by Congress after negotiations with the White House had satisfied most of his concerns and had given him enough latitude to manage counterterrorism and foreign policy in keeping with administration principles.

“The fact that I support this bill as a whole does not mean I agree with everything in it,” Mr. Obama said in a statement issued in Hawaii, where he is on vacation. “I have signed this bill despite having serious reservations with certain provisions that regulate the detention, interrogation and prosecution of suspected terrorists.”

The bill authorizes $662 billion in military spending through 2012. It is a smaller amount than the Pentagon had asked for, but it does not impose the radical cuts that the military faces in coming years.