The measure, passed largely along party lines, would halt US military action until approved by Congress.