The Canada-to-US pipeline has been a top priority for Republicans in the new Republican-controlled Congress, but it faces a veto threat from President Barack Obama.
Senators voted 62 to 35 to end debate on the bill, which has taken most of January, and move to a vote on final passage, which is expected today.
The House has already passed its version of the bill.
But because the Senate added some amendments, the House either needs to act on the Senate version or the two chambers must negotiate a final version and pass it.
Also Read
Keystone XL, first proposed by TransCanada six years ago, would transport crude oil from the oil sands of Alberta, Canada to refineries along the US Gulf Coast.
Republicans -- and some Democrats -- hail it as a 1,179-mile (1,900-kilometer) shovel-ready construction project that would create 40,000 jobs and boost US energy security.
Many Democrats oppose it on environmental grounds, warning of the risks of pipeline leaks and how the "tar sands" oil takes more energy and water to process.
Republicans counter that moving oil by pipeline releases far fewer emissions than transporting it by rail or road.
Earlier this month Keystone supporters earned a major victory when a state court in Nebraska dismissed a suit challenging the proposed route of the pipeline.
New Senate Majority Leader Mitch McConnell, in a bid to return the chamber to "regular order," allowed consideration of more than two dozen amendments to the legislation, more than the amendments that were openly considered during all of last year.