The McCain campaign distanced itself Thursday from a top adviser’s remarks about America becoming “a nation of whiners.” Rival Barack Obama ridiculed comments by former Texas Sen. Phil Gramm, a top adviser and surrogate for the Republican senator’s presidential bid, who told The Washington Times that the media has over-hyped the state of the nation’s economic slowdown and created a “mental recession.”

During a town hall in Fairfax, Va., Mr. Obama quoted Mr. Gramm extensively and mocked him, prompting the several thousand in the audience to snicker. “He named the U.S., and I quote, ‘a nation of whiners.’ Whoa,” Mr. Obama said. “A nation of whiners?”

The presumptive Democratic nominee said it was as if Mr. Gramm meant, “It’s a figment of your imagination, these high gas prices.”

“This comes after Senator McCain recently admitted that his energy proposals for the gas tax holiday and drilling will have mainly psychological benefits,” Mr. Obama continued as the audience laughed.

“America only has one Dr. Phil ,” he said. “When it comes to the economy, we don’t need another one. It’s not just a figment of your imagination, it’s not all in your head.”

Top McCain adviser Mark Salter said Mr. Gramm’s comments are not representative of Mr. McCain’s views.

“McCain travels the country every day talking to American who are hurting, feeling pain at the pump and wondering how they will pay their mortgage,” Mr. Salter said.

On Wednesday, Mr. Gramm told editors and reporters at The Washington Times that the news media’s reporting on the economic slowdown was wildly exaggerated. The country was not in a recession yet, he said, or in a depression, because it was still growing, albeit more slowly, and unemployment remained relatively low at 5.5 percent.

“You’ve heard of mental depression; this is a mental recession,” he said of polls showing that most Americans were deeply pessimistic about the economy.

“We have sort of become a nation of whiners,” he said. “You just hear this constant whining, complaining about the loss of competitiveness, America in decline” despite a boom in U.S. exports and continued growth.

Mr. Gramm expanded on his point in a telephone call to this newspaper on Thursday.

“When I spoke of whiners at my breakfast with the Washington Times on Wednesday, I was talking about American leaders who whine instead of lead,” Mr. Gramm said in the phone call.

He said he was talking about American “leaders who blame speculators and oil companies for high oil prices and yet have no proposal to produce more energy here at home.”

The former Texas senator said he also he was referring to “leaders who think we can’t compete with even Mexico and believe that we should build a wall around America and go hide under a rock somewhere.”

“Certain too many members of Congress and the Barack Obama campaign fall into the category of whiners,” he said, adding: “We don’t need whining. We need leadership.”

The Democratic National Committee also condemned Mr. Gramm’s comments, saying he was “callously ignoring the realities Americans are enduring.

The DNC, which portrays the economy as mired in recession, took issue with Mr. Gramm’s take on the economy.

“What John McCain, George Bush, Phil Gramm just don’t understand is that the American people aren’t whining about the state of the economy, they are suffering under the weight of it the weight of eight years of Bush-enomics that John McCain and Phil Gramm have vowed to continue,” said Karen Finney, the DNC’s communications director.

“How dare John McCain and his advisers so callously dismiss the challenges the American people face? No wonder voters feel John McCain is out of touch. He and his campaign don’t even understand the everyday issues Americans are dealing with,” she said.

Mr. Salter said Mr. McCain has proposed a federal gas-tax holiday and a comprehensive economic growth plan for the nation to help Americans.

“That is why John McCain has a realistic plan to deliver immediate relief at the gas pump, grow our economy and put Americans back to work,” he said.