The nearly party line vote moves the unusually contentious measure forward after it earlier stalled in both chambers of Congress.