“I’m really mad!” shouted a man in the audience in Waukesha, where Mr. McCain and his running mate, Gov. Sarah Palin of Alaska, were conducting a town-hall-style meeting. “And what’s going to surprise you, it’s not the economy. It’s the socialists taking over our country.”

A short time later, James T. Harris, a conservative talk radio host in Wisconsin who was one of the few African-Americans in the crowd, stood up and told Mr. McCain that in the next presidential debate, on Wednesday, “it’s absolutely vital that you take it to Obama, that you hit him” where it hurts, because “we have all of these shady characters that have surrounded him,” as well as, he said, Mr. Obama’s former pastor, the Rev. Jeremiah A. Wright Jr.

Although Mr. McCain did not mention Mr. Ayers, a founder of the radical group the Weather Underground, by name, his intent was clear in his response to a question about Mr. Obama. A man told Mr. McCain that “we’re all wondering why Obama is where he’s at” in the polls and then asked, “Is there not a way to get around this media and line up the people he has hung with?”

Mr. McCain responded, “Well, sir, with your help and the people in this room, we will find out.” He added: “Look, we don’t care about an old washed-up terrorist and his wife, who still, at least on Sept. 11, 2001, said he still wanted to bomb more. You know, but that’s not the point here. The point is, Senator Obama said he was just a guy in the neighborhood. We need to know that’s not true.”

Although Mr. McCain raised questions about Mr. Obama’s ties to Mr. Ayers in a televised interview last spring, he has refrained from attacking Mr. Obama on the trail for his association with Mr. Ayers in the general election campaign. He had left those attacks to his campaign operatives and Ms. Palin.