WASHINGTON (AP) — Newt Gingrich, the latest candidate to vie for the lead in the Republican presidential race, risked alienating conservatives in a televised debate by saying he favors pathways to legal status for illegal immigrants who have lived peaceful, law-abiding, taxpaying lives in the United States for many years.

The former Speaker of the House of Representatives was highlighting his break with current Republican thinking on immigration Tuesday as he tried to capitalize on recent gains in opinion polls.

"I don't see how the party that says it's the party of the family is going to adopt an immigration policy which destroys families which have been here a quarter-century," Gingrich said in the forum, televised on CNN. "I'm prepared to take the heat for saying let's be humane in enforcing the law."

Other candidates on the stage were quick to condemn his remarks as supporting what is known by many in the party simply as "amnesty" — usually understood as a policy that would provide ways for most or all illegal immigrants to remain in the country. Many conservatives strongly oppose granting legal residency to illegal immigrants — especially from Mexico and Central America — under almost any circumstance.

Mitt Romney — the former Massachusetts governor, venture capitalist and the establishment's favorite — was among those who swung back at Gingrich. He said that any type of pathway to legal status would be a magnet for more unlawful crossings from Mexico.

Immigration has vexed U.S. politicians for years. Many analysts say Republicans risk angering the fast-growing Hispanic population by showing little sympathy for the millions of illegal residents already here.

Gingrich, like fellow Republicans John McCain and George W. Bush, has supported more lenient immigration policies in the past. On Tuesday he chose to portray his record as humane and courageous. In coming days, Republican insiders will watch to see if voter reaction mirrors the rebuke that Texas Gov. Rick Perry suffered for saying people are heartless if they don't support his policy of granting in-state college tuition to illegal immigrants.

"Newt did himself significant harm tonight on immigration among caucus and primary voters," said Tim Albrecht, deputy chief of staff to Iowa Gov. Terry Branstad, on Twitter.

Gingrich is near the top of many polls now, but it is not clear if he can stay at the top. Beyond questions about his divorces, extramarital affairs and business dealings, his past views on climate change and other issues could be seen as too moderate for some conservatives.

Pushing new ideas for conservative governance and congressional reform, Gingrich was the face of a 1994 electoral victory that put his party in control of the House for the first time in 40 years. Four years later, after overreaching in his battles with President Bill Clinton and even some fellow Republicans, Gingrich was dumped from leadership. He soon left Congress.

Since then he has lectured, written books, made documentaries and earned millions of dollars as a consultant to organizations, including Freddie Mac, a backer of thousands of home mortgages.

The Tuesday night debate was the second in less than two weeks to focus on foreign affairs in a race otherwise dominated by domestic issues. Republicans see the weak U.S. economy as President Barack Obama's biggest vulnerability.

The debate came six weeks before the first nominating contest, the Iowa caucuses. Candidates were looking to build or — for Gingrich and Romney — sustain momentum.

Turning to the Middle East, Gingrich said the United States and its allies could "break Iran in a year," and that ending gasoline sales to Iran and sabotaging its refineries would lead to the collapse of the Iranian government and end its nuclear ambitions.

He said he would bomb Iran only as a last resort and with a goal of bringing about the downfall of the government.

The candidates sparred over how far America should go in sacrificing liberty in order to prevent terrorist attacks.

Gingrich backed the anti-terrorism law known as the Patriot Act, which was passed after the Sept. 11, 2001, attacks and has been criticized by civil libertarians. But Congressman Ron Paul warned that the law is "unpatriotic because it undermines our liberties."

Paul clashed with other candidates with his views not only on the Patriot Act, but also in his calls to cut aid to Israel, withdraw troops from Afghanistan and decriminalize drugs. His libertarian views have won him a solid core of supporters but he has been unable to break into the top tier of the race.

Paul also went against the grain in supporting large cuts in the defense budget to narrow the U.S. deficit.

Romney opposed the cuts, suggesting the money taken from the military would be used to fund Obama's health care program, which is widely disliked by Republicans. He said the cuts would crimp weapons acquisition and other critical defense needs.

Except for longshot candidate Jon Huntsman, Obama's former ambassador to China, the Republican contenders generally lack significant foreign affairs experience.

But with unemployment stubbornly high and the economy sluggish to recover from recession, the candidates have been driving the foreign policy discussion back to pocketbook issues at home. American voters tend to hold the sitting president responsible for the state of the whole national economy.

A day earlier, a bipartisan congressional panel charged with recommending measures to reduce the giant U.S. deficit declared an impasse. That could trigger deep cuts in 2013 spreading across military as well as domestic spending.

Romney, who has the most sophisticated political and fundraising machine among the Republican candidates, has led the race for most of the year, but has been unable to expand his support beyond about a quarter of those polled.

Still he continues to pick up endorsements from high-profile Republicans as he looks to demonstrate his strength before the first nominating contest. The latest is South Dakota Sen. John Thune, a rising star in the party. Thune was set to appear with Romney in Des Moines, Iowa, on Wednesday.


Associated Press writer Charles Babington contributed to this report

Copyright 2011 The Associated Press.