The vote comes after an agreement was reached by a group of Democrats who voted with Republicans to advance a measure to end the shutdown, the longest in US history. It now heads to the House for a final vote.