GREENVILLE, S.C. -- Former New Mexico Gov. Gary Johnson said ahead of the debate tonight that the U.S. should get out of Afghanistan now that Osama bin Laden is dead. He also went out of his way to challenge Tea Party views on immigration.

Speaking to a Tea Party rally here ahead of the 9 p.m. debate, Johnson spoke for 13 minutes on a range of subjects, drawing applause at some points and silence at others from a crowd that appeared to be comprised largely of Ron Paul supporters.

The crowd applauded warmly when Johnson said that the U.S. should have a strong defense but get out of the practice of “nation-building,” in part because it costs the Treasury too much money.

“We got Osama bin Laden. Let’s get out of Afghanistan,” Johnson said to more applause. He also said he was “opposed to what we did in Libya, A through Z.”

“Where was the military threat?” he said. “Where in the Constitution does it say that just because we don’t like a foreign leader we just go in and topple a foreign leader?”

Johnson’s call for the abolition of the Department of Education also met loud applause.

But his insistence that Medicaid and Medicare should be cut to balance the budget was met with silence.

A demand that the Federal Reserve be audited went over well. And while Johnson’s position that marijuana should be legalized got an enthusiastic response from some, others sat with arms crossed.

Johnson went out of his way to challenge attitudes widely held by conservatives on immigration -- including objecting to closing the U.S.-Mexico border.

“I think that immigration ultimately is a good thing,” he said, arguing that the U.S. should “make it as easy as possible for an individual that wants to come into this country to get a work visa ... so that applicable taxes would get paid.”

“For the [estimated] 11 million [undocumented immigrants] that are here, get them a work visa,” he said. “The notion of building a fence across 2000 miles of border, the notion of putting the National Guard arm in arm across 2,000 miles of border, in my opinion would be a whole lot of money spent with very little, if any, benefit whatsoever.”

Asked whether he was trying to make a point and confront conservatives on immigration, Johnson told The Huffington Post that the idea of building a fence or using the National Guard to close off the flow of immigrants from Mexico and Central and South America is “unrealistic.”

“I gotta tell you, it’s not going to work. It’s as simple as an 11-foot ladder to get across a 10-foot fence,” he said.

Asked about the crowd’s mixed reaction to his speech, Johnson indicated his appearance at the debate was intended to promote ideas as much as his potential presidential campaign.

“Oftentimes when there is no applause, when it’s a cussing go on, and discussion going along with that, often times that’s when you make the biggest headway,” he said.