A long-simmering debate over immigration in the Republican presidential contest boiled over on Thursday, as Senator Ted Cruz accused his colleague, Senator Marco Rubio, of “trying to jam this amnesty down the American people’s throats.”

From appearances on conservative talk radio to the campaign trail in South Carolina and New Hampshire, five Republican candidates jumped on the issue as they sought to appeal to grass-roots conservatives alarmed about immigration. And the eruption of open warfare between Mr. Rubio and Mr. Cruz, two candidates representing different wings of the party, showed the likely contours of the Republican presidential fight as it hurtles toward the Iowa caucuses in less than 90 days.

Immigration is a key vulnerability for Mr. Rubio, who was initially part of an effort in 2013 to formulate a bipartisan bill in the Senate to overhaul the immigration system. His subsequent moves to distance himself from his role in fashioning the bill have left some conservatives distrustful of his candidacy.

Mr. Cruz, in an appearance with the conservative radio host Laura Ingraham, denounced Mr. Rubio without using his name and by using a biblical allusion, saying: “You know where someone is based on their actions. As the Scripture says, you shall know them based on their fruits.”

The flare-up came as three other lower-polling candidates — Senator Rand Paul of Kentucky; Rick Santorum, a former Pennsylvania senator; and Carly Fiorina, a former chief executive of Hewlett-Packard — joined the fight, piling on Mr. Rubio or Mr. Cruz as insufficiently pure on a key litmus test for segments of the Republican base.

The long-distance skirmishing illustrated the degree to which several candidates see immigration, which emerged as a key issue in the 2014 midterm elections, as the most potent weapon in their arsenal in a presidential contest that has been characterized by concerns about the direction of the country.

Yet, because of his work on the 2013 immigration reform effort, Mr. Rubio is more familiar with the nuances of the immigration debate than some of his rivals. When asked about Mr. Cruz’s critique while campaigning Thursday in South Carolina, Mr. Rubio sought to turn the tables, highlighting the Texas senator’s support of allowing more visas to bring foreign professionals with college degrees and specialized skills into the country.

“He supported a massive expansion of the H-1B program, a 500 percent increase,” he said. “So, if you look at it, I don’t think our positions are dramatically different. I do believe that we have to deal with immigration reform in a serious way, and it begins by proving to people that illegal immigration is under control.”

During his campaign, Mr. Rubio has said that immigration reform can be addressed only after the border is first secured. He is not in favor of deporting illegal immigrants en masse, as proposed by Donald J. Trump, who leads most polls for the nomination.

The topic of immigration, and the candidates’ efforts to appeal to conservatives on the issue, are taking on new urgency in a race in which Mr. Trump has used caustic language about immigrants and has also called for a “beautiful” border wall to keep Mexican immigrants from illegally entering the country.

Indeed, the strident language on immigration percolated Thursday to the lower rungs of the Republican field, with Mrs. Fiorina and Mr. Paul echoing Mr. Cruz’s comments.

“I think Marco Rubio’s tax credit plan will extend more tax credits to illegal aliens,” Mr. Paul said. “There’s no way in the world we should support this.”

Mrs. Fiorina suggested that Mr. Rubio’s recent comments against illegal immigration showed how he was a conventional politician shifting to fit the mood of the party.

In New Hampshire on Thursday morning, Mr. Cruz denounced what he called “campaign conservatives” and insisted he had been consistent on issues.

And Mr. Cruz on Thursday found himself exposed to criticism on immigration from others beside Mr. Rubio: Mr. Santorum, a staunch conservative who was vocal during the culture wars of the 1990s and who won the Iowa caucuses in 2012, sought to paint the Texas senator as inconsistent.

“Cruz tough on immigration? Not so fast!” read a release from Mr. Santorum’s campaign, citing the same issue — guest-worker visas — that Mr. Rubio did. In an interview, Mr. Santorum pointed to Mr. Cruz’s support in 2013 for an amendment to the immigration bill that Mr. Rubio worked on, which would have eliminated a pathway to citizenship for undocumented immigrants, but would have granted them legal status to remain in the country.

Most Republicans “would say in either case, it’s amnesty,” Mr. Santorum said.

And in a signal of how hard he intends to fight back, Mr. Rubio’s aides posted on Twitter and emailed supporters about a video clip of Mr. Cruz discussing that amendment. Mr. Cruz has since changed his stand on increasing the number of H-1B visas, saying the program needs to be reformed to guard against abuses.

Illegal immigration has been an animating issue among a segment of the Republican voters for years. But that has particularly been the case in this year’s contest, as the party’s base is increasingly dominated by older, whiter, working-class voters who have seen their political clout and numbers dwindle in recent years.

The immigration issue flared briefly during the Republican debate on Tuesday night in Milwaukee, with Jeb Bush, the former governor of Florida, and Gov. John Kasich of Ohio saying there was no way to conduct the types of mass deportations that Mr. Trump has called for.

Just after they addressed the issue, the Fox Business Network moderators turned to Mr. Rubio, but instead of pressing him on the issue, they turned to a new topic, sparing him difficult questions in front of a nationally televised audience. But Mr. Cruz seized on the issue when the questions turned to him that night, criticizing those who support “amnesty,” and opening up a new front that was followed by directly targeting Mr. Rubio on Thursday.

Many establishment Republicans and donors support an immigration overhaul and legislation that allows a pathway to citizenship. They are a group to whom Mr. Rubio has appealed in part by arguing that the party has to change the way it speaks to Hispanic voters. And they have been vocal in their fears that the party will be hindered in the general election among Hispanic voters after a nominating contest in which the word “amnesty” is frequently used.

But Mr. Rubio’s own language has at times grown harsher; on Thursday, in an interview with the Fox News Channel, Mr. Rubio sounded a note of law and order.

“We are going to have to deport some people; otherwise, if you’re not going to enforce the law, what’s the point of having those laws?” Mr. Rubio said. “Criminals are going to be deported. People who haven’t been here very long are going to be deported. People overstaying visas are going to have to be deported. That’s how you enforce immigration laws.”

Javier Palomarez, the president of the Hispanic Chamber of Commerce, suggested in an interview that what Mr. Rubio was describing would still involve deporting nearly six million people. “We have to be careful with our words,” he said. But he declined to criticize Mr. Rubio, saying he wants the chance to speak with him first.

But for immigration hard-liners, Mr. Rubio and Mr. Cruz fall short of their expectations.

“They still want to talk about this issue in a way that will get a visceral reaction from primary voters but still won’t alienate their fund-raisers,” said Mark Krikorian, the executive director of the Center for Immigration Studies. “At some point, they’re going to have to choose between the voters and the billionaires.”