WASHINGTON -- The Senate passed a $662 billion Pentagon funding bill Thursday night after days of fights among lawmakers over terrorism-related provisions that would authorize indefinite detention without trial and give preference to military detention of terror suspects instead of the civilian justice system.

The Obama administration has threatened to veto the legislation, arguing the executive branch should decide how to try terror detainees.

The...