Sen. Ted Cruz switched his position on major trade legislation that expedites presidential trade negotiations, announcing early Tuesday he would vote against the bill just hours before the Senate voted to narrowly pass the deal.

The Texas Republican publicized his vote reversal in an op-ed for Breitbart News, citing immigration provisions covered under Trade Promotion Authority and “corrupt” backroom deals guaranteeing fast-track skeptics’ support in exchange for the Export-Import Bank’s reauthorization.

Cruz originally supported fast-track authority, calling it a “fair deal for the American worker” that enhances government transparency, in an earlier Wall Street Journal op-ed.

But Cruz pointed to two changes surrounding the bill since his original vote that pushed him to switch his position.

He said prior to the first Senate vote, the Obama administration assured lawmakers the bill did not involve changes to federal immigration law. But, a subsequent WikiLeaks post revealed portions of an agreement falling under TPA, which “explicitly” made changes to immigration law.

“The assurances we had been given appear to be contradicted by the text of the trade agreement that came out after,” Cruz told reporters following the Senate’s vote.

Cruz also cited a “secret” deal between Republican leaders and Democrats, claiming GOP lawmakers assured Ex-Im supporters a vote for reauthorization in exchange for TPA’s passage in the House and Senate. Prior to the first fast-track vote, Cruz said he believed Senate Majority Leader Mitch McConnell’s guarantee that no deal had been made.

“On the basis of that assurance, I voted ‘yes.’ However, subsequently watching this matter play out in the House, it becomes apparent that whether there was a deal then or not, there is one now,” Cruz said after Tuesday’s vote.

He said evidence of a deal became apparent after Boehner refused to guarantee House conservatives Ex-Im’s expiration in return for TPA support.

“I support free trade and have vocally supported free trade for a long time. But the cronyism and the backroom deals is unacceptable. I’ve made very clear I would happily vote to support TPA if leadership would explicitly commit to allow the Export-Import Bank to expire and stay expired,” Cruz said.

He added future support for TPA is also contingent on the passage of amendments blocking changes to immigration under fast-track introduced by Sen. Jeff Sessions, R-Ala., and him.

“Based on the assurances that are being said publicly, both of those are very reasonable, modest conditions,” he said.