Sen. John McCain threatened on Tuesday to cut short a speech to union leaders who booed his immigration views and later challenged his statements on organized labor and the Iraq war.

"If you like, I will leave," McCain told the AFL-CIO's Building and Construction Trades Department, pivoting briefly from the lectern. He returned to the microphone after the crowd quieted.

"OK, then please give me the courtesy I would give you."

It was a contentious session that tested McCain's commitment to the straight-talking image he honed during his failed 2000 presidential bid. An underdog six years ago, the Arizona Republican is expected to seek the 2008 GOP nomination as a front-runner.

"I loved it. I love mixing it up like that," McCain said after the speech to a Democratic-leaning crowd of several hundred.

He did seem to enjoy the back and forth that began minutes into his address, when he mentioned campaigning on behalf of California Gov. Arnold Schwarzenegger, a fellow Republican. The crowd booed the reference to Schwarzenegger but laughed at McCain's self-effacing joke that followed.

He said somebody came up to him at the Schwarzenegger event and said, "Do people tell you look like John McCain?"

"Yes, they do."

"Doesn't that make you madder than hell?"

Later, the senator outlined his position on the Senate immigration debate, saying tougher border enforcement must be accompanied by guest worker provisions that give illegal immigrants a legal path toward citizenship.

Murmurs from the crowd turned to booing. "Pay a decent wage!" one audience member shouted.

"I've heard that statement before," McCain said before threatening to leave.

Afterward, the senator said he offered to cut his speech short "because I wanted to be heard."

In the speech, McCain also argued that withdrawing U.S. troops prematurely from Iraq would turn terrorists loose on the United States.

This time, there was no booing — though one audience member cursed from the back of the crowd.

McCain got another laugh when he finished the speech and asked whether anybody had "questions, comments or insults."

The first questioner seemed to challenge his commitment to organized labor. When McCain started to praise a particular labor group in Arizona, the crowd booed again.

"Stop!" he said with a smile, drawing laughter from the crowd. "I surrender."

But he took more questions, including a pointed one on his immigration plan.

McCain responded by saying immigrants were taking jobs nobody else wanted. He offered anybody in the crowd $50 an hour to pick lettuce in Arizona.

Shouts of protest rose from the crowd, with some accepting McCain's job offer.

"I'll take it!" one man shouted.

McCain insisted none of them would do such menial labor for a complete season. "You can't do it, my friends."

Some in the crowd said they didn't appreciate McCain questioning their work ethic.

"I was impressed with his comedy routine and ability to tap dance without music. But I was impressed with nothing else about him," said John Wasniewski of Milwaukee. "He's supposed to be Mr. Straight Talk?"

Others said McCain showed some moxie, if not the best political judgment.

"Most of us don't agree with him on immigration, but I give him credit for trying," said Chris D. Schoenbeck of Milwaukee.

With his profile rising, a growing number of Democrats are accusing McCain of flip-flopping on issues to court conservative GOP primary voters.

McCain denied that charge later Tuesday — after addressing the Hispanic Chamber of Commerce, a GOP-leaning group that backs his immigration views. There were no boos. Just laughter, and at the end of his remarks, a standing ovation from the Hispanic leaders.

Yet McCain's mind was still on the labor activists and their prickly reception.

"I can't tell you how much fun that was," he said.