The vote, 51-48, fell along mostly party lines, but with sharp dissent from two prominent GOP senators. It could not have come at a more difficult political moment.