Cedar Rapids, Iowa (CNN) On the campaign trail, Ted Cruz says he's the "consistent conservative" -- the one candidate who always sticks to his principles.

But on immigration, that's an open question.

The Texas senator has long been a fierce proponent of expanding legal immigration and visas for high-skilled workers, so much so that he repeatedly broke with immigration hardliners like Sen. Jeff Sessions during Senate Judiciary Committee proceedings in 2013. Now, Cruz is advocating a tough approach that would impose a temporary halt on legal immigration -- a significant reversal for a senator who espoused more moderate positions on immigration in Congress than on the campaign trail.

While much of the recent scrutiny on Cruz's immigration record has been on whether he backs legalizing the 11 million undocumented immigrants already in the country, there is no doubt that Cruz was a staunch advocate of opening U.S. borders for those entering into the United States through the proper legal channels. He fought to allow more legal immigrants into the United States during the Senate's most consequential immigration debate since George W. Bush's presidency.

A deeper look at Cruz's record -- particularly during the divisive 2013 immigration debate -- showcases how the junior senator from Texas was seeking to promote a view of immigration that could appeal to constituents in a border state transformed by an influx of migrants. A review of nearly 1,000 pages of transcripts from the five days of committee votes shows how the Texas firebrand took a nuanced view -- repeatedly saying he wanted the bill to pass with several changes, especially expanded legal immigration.

"I don't want this bill to be voted down and I hope the stakeholders who want this bill to be passed will be interested in amendments to craft a bill that will pass," Cruz said. "And I look forward to working with the committee members in that process."

Cruz ultimately opposed the so-called Gang of Eight bill, which was co-authored by his chief presidential rival, Sen. Marco Rubio of Florida, and would have been the most expansive rewrite of immigration laws in nearly three decades. He now says he wouldn't give permanent legal status to any of the nation's 11 million undocumented immigrants and touts his role in leading the fight in the Senate Judiciary Committee to kill the bill.

Photos: Moments from Ted Cruz's career Photos: Moments from Ted Cruz's career U.S. Sen. Ted Cruz, a Republican presidential candidate, speaks during a campaign rally at the Indiana State Fairgrounds on Monday, May 2. Hide Caption 1 of 24 Photos: Moments from Ted Cruz's career Cruz holds up the hand of Carly Fiorina at a campaign rally in Indianapolis on Wednesday, April 27. Cruz named Fiorina, a former presidential candidate, as his running mate. Hide Caption 2 of 24 Photos: Moments from Ted Cruz's career Cruz celebrates his Wisconsin primary win with his wife, Heidi, and Gov. Scott Walker in Milwaukee on Tuesday, April 5. Walker endorsed Cruz for the presidency. Hide Caption 3 of 24 Photos: Moments from Ted Cruz's career With his wife by his side, Cruz tours the Dane Manufacturing facility before speaking to workers in Dane, Wisconsin, on Thursday, March 24. Hide Caption 4 of 24 Photos: Moments from Ted Cruz's career Cruz speaks during the CNN Republican debate in Miami on Thursday, March 10. Hide Caption 5 of 24 Photos: Moments from Ted Cruz's career Cruz and his wife wave to the crowd at Liberty University after he announced his presidential candidacy in Lynchburg, Virginia, on March 23, 2015. Hide Caption 6 of 24 Photos: Moments from Ted Cruz's career Cruz speaks during the 2013 NRA Annual Meeting and Exhibits at the George R. Brown Convention Center on May 3, 2013, in Houston, Texas. Hide Caption 7 of 24 Photos: Moments from Ted Cruz's career Cruz poses with his wife, Heidi, and his daughters Caroline and Catherine. Hide Caption 8 of 24 Photos: Moments from Ted Cruz's career Cruz (left) fields questions from Bruce Rastetter at the Iowa Ag Summit on March 7, 2015, in Des Moines, Iowa. The event allows the invited speakers, many of whom are potential 2016 Republican presidential hopefuls, to outline their views on agricultural issue. Hide Caption 9 of 24 Photos: Moments from Ted Cruz's career Nobel Peace Laureate Elie Wiesel (left) listens as Cruz (right) speaks during a roundtable discussion on Capitol Hill March 2, 2015 in Washington, D.C. Wiesel, Cruz and Rabbi Scmuley Boteach (center) participated in a discussion entitled 'The Meaning of Never Again: Guarding Against a Nuclear Iran.' Hide Caption 10 of 24 Photos: Moments from Ted Cruz's career Governor Greg Abbott (center) speaks alongside Cruz (left), Attorney General Ken Paxton (right) at a joint press conference February 18, 2015, in Austin, Texas. Hide Caption 11 of 24 Photos: Moments from Ted Cruz's career Sen. Patrick Leahy (right) escorts Loretta Lynch back from a lunch break as Cruz (left) sits nearby during her confirmation hearing before the Senate Judiciary Committee January 28, 2015, on Capitol Hill. Hide Caption 12 of 24 Photos: Moments from Ted Cruz's career Cruz greets supporters at the South Carolina Tea Party Coalition convention on January 18, 2015, in Myrtle Beach, South Carolina. A variety of conservative presidential hopefuls spoke at the gathering on the second day of a three-day event. Hide Caption 13 of 24 Photos: Moments from Ted Cruz's career Cruz (left) and then-Texas Governor Rick Perry stand together during a press conference at the front gate of Fort Hood about Iraq war veteran, Ivan Lopez, who killed three and wounded 16 before taking his own life on April 4, 2014, in Fort Hood, Texas. Hide Caption 14 of 24 Photos: Moments from Ted Cruz's career (Left to right) Sen. Lindsey Graham, Sen. John McCain and Cruz listen as President Barack Obama delivers the State of the Union address on January 28, 2014, in Washington, D.C. Hide Caption 15 of 24 Photos: Moments from Ted Cruz's career Then-Senate Minority Leader Mitch McConnell (second right), poses with Republican senators-elect Jeff Flake (left), Deb Fischer (second left), and Cruz (right) at the U.S. Capitol on November 13, 2012, in Washington, D.C. Hide Caption 16 of 24 Photos: Moments from Ted Cruz's career Cruz speaks to reporters on September 25, 2013, after ending his talk-a-thon on the floor of the US Senate in Washington, D.C. Hide Caption 17 of 24 Photos: Moments from Ted Cruz's career Cruz speaks as then-Rep. Michele Bachmann (left), Sen. Mike Lee (second right) and Sen. Rand Paul (right) listen during a news conference May 16, 2013, on Capitol Hill. Hide Caption 18 of 24 Photos: Moments from Ted Cruz's career Cruz listens to testimony during a Senate Judiciary Committee hearing on April 22, 2013, in Washington, D.C. Hide Caption 19 of 24 Photos: Moments from Ted Cruz's career Cruz holds a news conference to announce the plan to defund Obamacare on March 13, 2013. Hide Caption 20 of 24 Photos: Moments from Ted Cruz's career Cruz speaks at the CPAC on March 6, 2014, in National Harbor, Maryland. Hide Caption 21 of 24 Photos: Moments from Ted Cruz's career Then-Senate Republican Candidate and Texas Solicitor General Cruz speaks at the 'Patriots for Romney-Ryan Reception' on August 29, 2012, in Tampa, Florida. Hide Caption 22 of 24 Photos: Moments from Ted Cruz's career Then-Senate Republican Candidate and Texas Solicitor General Cruz speaks during the Republican National Convention at the Tampa Bay Times Forum on August 28, 2012. Hide Caption 23 of 24 Photos: Moments from Ted Cruz's career Then-Senate Republican Candidate and Texas Solicitor General Cruz speaks during the Republican National Convention in 2012. Hide Caption 24 of 24

But a CNN review of the committee transcripts shows that not once did he use the word "amnesty" in describing illegal immigration during the five days of lengthy deliberations, a common mantra for Cruz on the campaign trail today. And he sought to both double the cap of legal immigration from 675,000 to 1.3 million and pushed for a dramatic increase of 500% for high-skilled H-1B visas to 325,000.

When Sessions, the Alabama Republican, sought to issue stringent new caps on visas issued to foreigners from across the globe, Cruz pushed back.

"I intend to vote no on this amendment, and the reason is I think legal immigration is a fundamental pillar of our country," Cruz said at the committee debate. "And I think, as a nation, we need to remain a nation that doesn't just welcome, but that celebrates legal immigrants around this table."

Speaking to reporters here in Cedar Rapids Tuesday, Rubio seized on Cruz's past positions to paint him as a flip-flopper on an issue that riles up the conservative base.

"I understand now he has changed his position," Rubio said. "He has a right to change his position, it's a different position."

Rubio added: "He supported a massive expansion of temporary guest workers coming into the United States, he supported a massive doubling of the number of green cards -- so his position is different than what is now."

Catherine Frazier, a Cruz spokeswoman, strongly denied that Cruz is shifting his positions on the issue. She said that the Texas Republican sought to mold the immigration bill into a plan that conservatives could get behind by offering a variety of amendments. She also said that Cruz had sought to tie the growth of legal immigration to border security, saying that enforcement always came first in his mind.

"It's completely dishonest to suggest that Sen. Cruz is not a staunch proponent of securing the border," Frazier said. "And he believes that needs to be the first priority in fixing our immigration system."

In November, under pressure from conservative talk radio and Rubio, Cruz issued an immigration plan that went even further right than Sessions' 2013 amendment, which the Texas Republican opposed. The new plan would in part halt all legal immigration until the unemployment rate decreases. The new plan also would end birthright citizenship, suspend the H-1B visa program for 180 days to investigate alleged abuses and deny certain government aid to legal immigrants.

During the 2013 markup, however, Cruz had a different approach.

"I think we need to remain a nation that welcomes and embraces legal immigrants and in both regards my amendments go further to improving legal -- legal immigration than does the Gang of Eight," Cruz said.

Among the changes he sought at the time: Beefed up border security, limiting welfare benefits to undocumented immigrants, removing the path to citizenship for the undocumented and a dramatic expansion of legal immigration.

Sharp campaign rhetoric

On Tuesday, Cruz's campaign unveiled an ad showcasing a tough approach on the issue.

"If I'm elected president, we will triple the border patrol. We will build a wall that works. Will secure the border," he said.

The ad comes after Cruz has been vaulting in the polls here in Iowa, where he has been endorsed by Rep. Steve King, a leading immigration hardliner. He told an Iowa voter this week that he would prevent deported immigrants from reentering the country, moving to the right of GOP presidential front-runner Donald Trump on the issue.

Cruz's immigration record came under the spotlight in November after Rubio sought to muddy the waters by spotlighting the Texas Republican's position on legal immigration. Specifically, Rubio pointed to an amendment offered by Cruz in 2013 to eliminate the path to citizenship -- but still offer undocumented immigrants the opportunity to obtain a legalized status. Sessions backed the amendment, which ultimately failed.

"They would still be eligible for legal status," Cruz stressed in defending the amendment during the committee deliberations.

During CNN's Republican presidential debate in December, Cruz and Rubio traded fire over the issue.

"Ted, you support legalizing people who are in this country illegally," Rubio said.

Cruz's response: "I have never supported legalization, and I do not intend to support legalization."

JUST WATCHED Marco Rubio attacks Ted Cruz's voting record Replay More Videos ... MUST WATCH Marco Rubio attacks Ted Cruz's voting record 02:38

When pressed on his amendments in recent weeks, Cruz has said it was part of a concerted strategy to tank the bill. Speaking to Laura Ingraham on her radio show before Thanksgiving, Cruz said he no longer backs expanding H-1B visas and he cited abuses of the program in recent years.

"I don't believe that's a good idea," Cruz told the radio host of a dramatic expansion of H-1B visas. "It's important to understand on the Senate Judiciary Committee, I was leading the fight along with Jeff Sessions to defeat this bill, the Gang of Eight bill. As a result, I was introducing a whole series of amendments, in part, to demonstrate the hypocrisy of the Democrats."

Cruz said it was part of a "concerted strategy" to defeat the Gang of Eight bill.

But that's hardly how he couched it in the 2013 deliberations. Cruz said that he was working in "good faith" to "improve" the bill so it could pass Congress and be signed into law. "We're actually trying to be helpful," he said during the committee markup.

On the campaign trail, his positioning has come under attack from Trump as well.

Speaking Sunday on CBS's "Face the Nation," Trump said the Texas Republican is "weak" on this issue, saying he was "copying" his plan, where the brash businessman proposed increasing the prevailing wage requirements for H-1B visa workers to discourage companies from hiring cheaper overseas workers.

"Ted Cruz is trying to step up his whole game on amnesty and illegal immigration, because it was actually quite weak," Trump said.

Shifting right

As part of Cruz's new plan, the senator called for suspending the H-1B visa program for 180 days to investigate abuses of the program and halt any increases in legal immigration so long "as American unemployment remains unacceptably high." He consulted with Sessions in calibrating his new immigration plan.

But during the 2013 committee proceedings, Cruz offered an amendment that would have increased H-1B visas from 65,000 to 325,000 -- regardless of unemployment rates or conditions in the market place.

(The unemployment rate was 7.6% in May 2013, compared to 5% in November, the last month for which data is available.)

JUST WATCHED Watch Ted Cruz coach his family through a campaign ad shoot Replay More Videos ... MUST WATCH Watch Ted Cruz coach his family through a campaign ad shoot 04:30

"I think the number that Senator Cruz has raised is a bit high," Sessions said with some alarm at the time.

Cruz strongly defended his idea.

"High- skilled immigrants whether temporary or permanent are, I believe, the data demonstrates pro-growth," Cruz said. "They generate jobs. They generate economic productivity."

On 11 occasions during the Senate Judiciary Committee's consideration of the immigration bill, Cruz voted opposite of the two staunchest immigration hardliners on the committee, Chuck Grassley of Iowa and Sessions.

Cruz supported an amendment offered by Chuck Schumer that would have, in part, provided additional up-front funding for implementing the bill -- something that conservatives like Sessions and Utah Sen. Mike Lee opposed.

He backed an amendment by Sen. Orrin Hatch, R-Utah, that would, in part, clear the way for spouses of H-1B visa holders to work. He opposed repeated efforts by Grassley to clamp down on H-1B visas, including an amendment to audit annually one percent of companies that sponsor high-skilled visas.

In one plan, Cruz sought to eliminate what he considered "arbitrary" caps for four countries -- China, India, Mexico and the Philippines. "I don't think we should be discriminating against those nations." The plan sought to consolidate various different high-skilled employment visas into a single visa, while increasing the number of family-based green cards.

Fighting back charges from Sen. Dick Durbin, D-Illinois, that Cruz was being too hard on undocumented workers, Cruz was indignant, saying he was hoping a consensus could be reached.

"I think it's unfortunate that my friend from Illinois would cast aspersions in terms of my motivations in what I'm saying," Cruz, a son of a Cuban immigrant, said in 2013. "This is an issue that is near and dear to many of us in this committee -- and it's near and dear and personal to a great many of us."