WASHINGTON — A razor-thin Senate vote Tuesday put President Obama on the cusp of claiming victory for his ambitious international trade agenda, clearing the way for legislation granting him “fast track” negotiating powers to potentially reach his desk by week’s end.

Sixty senators – the bare minimum needed – voted to advance the bill, with 13 Democrats joining 47 Republicans to provide the winning margin.

Both of Maine’s senators, Susan Collins, a Republican, and Angus King, an independent, voted against the bill.

The 60-37 procedural vote was the latest turn in a roller-coaster-like legislative process in which trade legislation has been assembled and approved by the Senate, then rejected in the House by Democrats, then reworked to secure passage there with mainly Republican support – a move that required it to come back to the Senate.

Tuesday’s vote was the first of several that will take place over the coming days on various pieces of the trade package, but it was the most crucial: Without 60 senators voting to limit debate Tuesday, the legislation would have languished indefinitely, endangering Obama’s top domestic priority.

White House press secretary Josh Earnest commended the Senate on Tuesday for moving forward, saying the completion of fast-track legislation this week “will send an important message to the world about America’s engagement and global leadership.”

The vote also was hailed by Senate Republicans, who have been locked in an unusual alliance with the Democratic president to advance the trade bills. Fast track, officially known as Trade Promotion Authority, will give Obama and his successor the power to negotiate trade deals knowing that Congress cannot amend them, only vote them up or down.

“We have demonstrated we can work together on a bipartisan basis to achieve something that is extremely important for America,” Majority Leader Mitch McConnell, R-Ky., said after the vote. Final passage of fast track, he added, “will indicate that America is back in the trade business; it also will send a message to our allies that we understand they’re somewhat wary about Chinese commercial and potentially military domination and that we intend to still be deeply involved in the Pacific.”

McConnell’s comment was a reference to the Trans-Pacific Partnership, an agreement under negotiation with 11 other Pacific Rim countries that will set rules, regulations and tariffs for economic relations between an estimated 40 percent of the global economy.

Earnest said the deal will “help America write the rules of the road and ensure our new global economy will be constructed to allow more hard-working Americans to compete and win. But our work on trade is not finished.”

The partisan breakdown of Tuesday’s vote was similar to the 62-37 vote to pass the legislation in May before it went to the House. One Democratic senator, Maryland’s Benjamin Cardin, voted no after previously voting yes, and one Republican senator in support, Tennessee’s Bob Corker, did not attend Tuesday’s vote.

Another Republican senator, Ted Cruz of Texas, switched his vote from yes to no, announcing in an opinion piece published Tuesday by Breitbart.com that conservatives had been sold out by GOP leaders on a separate issue – reauthorization of the Export-Import Bank – to gain Democratic votes.

“Why does Republican Leadership always give in to the Democrats?” wrote Cruz, a presidential candidate. “There’s too much corporate welfare, too much cronyism and corrupt dealmaking, by the Washington cartel.”

Tuesday’s vote sets up a vote on final passage of fast track Wednesday. But Republican leaders also have pledged to move companion legislation supported by Democrats that would authorize hundreds of millions of dollars in job training and other assistance to workers displaced by global trade.

Most congressional Democrats who voted to support fast track did so on the condition that the worker aid bill, known as Trade Adjustment Assistance (TAA), would be taken up alongside it. Most Republicans consider that program ineffective and wasteful but have agreed to advance it to secure approval for fast track.

Senate Finance Committee Chairman Orrin Hatch, R-Utah, called TAA “the price of admission” for many lawmakers voting in support of fast-track authority.

“Now it is time to finish the work to pass this bill and get it to the president’s desk,” Hatch said Tuesday. “We need this bill to ensure that our constituents’ voices are heard in the trade negotiating process. We need this bill to give our trade negotiators the tools they need to get a good deal, and we need this bill to extend access to foreign markets so we can grow our economy and create good, high-paying jobs here at home.”

But Democratic opponents of free-trade deals said it was not good enough to take Republicans’ word that the worker-aid legislation would advance alongside fast-track authority.

“People are going to lose their jobs, but we’re going to vote today to cut off debate, and we’re going to forget, at least temporarily, about helping those workers that lose jobs because of decisions we make,” said Ohio Sen. Sherrod Brown. “How immoral is that? How shameful is that? What a betrayal of those workers.”

McConnell pledged this week to attach TAA to a bill that would reauthorize various trade incentive programs. If passed, that legislation would return to the House, where it is expected to win passage with the support of Democrats who opposed TAA earlier this month in a tactical bid to derail the overall trade deal but who are likely to back it once it is clear that fast-track authority will become law.

Earnest said Tuesday that Obama “continues to urge Congress to send Trade Adjustment Assistance to his desk next week.”