WASHINGTON — Republican presidential contender John McCain, known for having a quirky sense of humor, joked about bombing Iran at a campaign appearance this week.

In response to an audience question about military action against Iran, the Arizona senator briefly sang the chorus of the surf-rocker classic “Barbara Ann.”

“That old, eh, that old Beach Boys song, Bomb Iran,” he said in jest Wednesday, chuckling with the crowd. Then, he softly sang to the melody: “Bomb, bomb, bomb, bomb, anyway, ah ...” The audience responded with more laughter.

His quip was prompted by a man in the audience who asked: “How many times do we have to prove that these people are blowing up people now, nevermind if they get a nuclear weapon, when do we send ‘em an airmail message to Tehran?”

The campaign stop was in Murrells Inlet, S.C.

After his joke, McCain turned serious and said that he agrees with President Bush that the United States must protect Israel from Iran and work to prevent Iran from acquiring nuclear weapons. McCain has long said the military option should not be taken off the table but that it should be used only as a last resort.

The episode echoed President Reagan’s 1984 quip at the height of the nuclear arms race when he said: “My fellow Americans, I’m pleased to tell you today that I’ve signed legislation that will outlaw Russia forever. We begin bombing in five minutes.”

Reagan was testing a microphone before his regular Saturday radio address.