NEW YORK — When US Senator John McCain took a shot at film maker Michael Moore in his speech to the Republican National Convention Monday night, he had no reason to know that the man who made the controversial documentary “Fahrenheit 9-11″ was just a few hundred feet away from him.

But Moore was in Madison Square Garden with McCain and thousands of Republicans who, it would be fair to say, do not rank “Fahrenheit 9-11″ high on their list of favorite films.

That was made obvious by the response of the delegates to McCain’s unprecedented targeting of Moore in his prime-time address to the convention.

In a speech that was at once a spirited defense of the war with Iraq and a reminder that he is still available for consideration as a 2008 presidential nominee, McCain earned his biggest applause when he rejected any and all criticism of the Bush administration’s decision to launch a preemptive war against the Middle Eastern country.

“Our choice wasn’t between a benign status quo and the bloodshed of war. It was between war and a graver threat. Don’t let anyone tell you otherwise. Not our political opponents,” the Arizona Republican said, as the crowd began to roar its approval. “And certainly not, certainly not, a disingenuous film maker who would have us believe that Saddam’s Iraq was an oasis of peace, when in fact it was a place of indescribable cruelty, torture chambers, mass graves and prisons that destroyed the lives of the small children inside their walls.”

Moore, who was seated in the press gallery of Madison Square Garden, pumped his fists in the air and tipped his hat to the McCain and the hooting delegates. As the crowd chanted “Four More Years,” Moore used his hand to form an “L” sign to suggest that President Bush would lose in November.

Moore also held up two fingers, recalling a constant theme of the filmmaker this week: That George W. Bush and Dick Cheney have only two more months to go before they are voted out of office.

Everyone in the hall, including McCain and Moore, realized that a rare moment in American politics was playing out. It’s not often, outside the context of a debate, that such charges and countercharges fly in close proximity. Nor is it all that often that a film achieves the level of public awareness that leads a prominent politician to attack its maker in a primetime convention speech. And it is certainly not common for the filmmaker to be in a position to respond in real time.

But Moore was there, and he did respond.

The Academy Award-winning documentary maker pointed out that “Fahrenheit 9-11″ did not argue that Iraq was an oasis of peace. Instead, Moore noted, his film suggested that the Bush Administration stretched the truth when it argued that regime change had to be forced upon Iraq in order to avert the threat posed by weapons of mass destruction that have yet to be found.

Still, Moore was not complaining too loudly.

“To bring up the film in the speech tonight, it’s not good for the Republican Party,” he explained. “It’s just going to make more people say: ‘I’d better go see this movie.’ And when people see it, they don’t feel much like voting Republican.”

Moore’s documentary, which challenges the Bush Administration’s pre-war claims about those weapons of mass destruction and about supposed links between Iraq and the al-Queda network terrorists who attacked the country on Sept. 11, 2001, was a hit. But Moore knows there are still plenty of Americans who haven’t seen it.

While what he got from McCain was not exactly a plug, the film maker predicted many of those who had not bought a ticket might do so now. And that, he said, could turn McCain’s jab into a problem for President Bush’s reelection prospects in a closely contested November vote.

“A Republican pollster told me that, when they do surveys, 80 percent of the people going into the theaters are Kerry voters. But 100 percent of the people coming out are Kerry voters — or at least they are open to voting for Kerry,” Moore said. “The pollster told me that they couldn’t find anyone who sees the film and then says they are definitely voting for Bush.”

So what was the man who made a film designed to undo a Republican president doing at the Republican National Convention?

Moore’s attended the convention on an assignment from USA Today, which has asked him to write a column about the gathering that will renominate two of favorite targets, President Bush and Vice President Cheney. While he had all the press credentials that were required for entry into the hall, Moore was held up for the better part of an hour by Madison Square Garden security and New York City police officers.

Moore was finally allowed to enter and took his place to the right of the podium at a table with other writers for USA Today. Photographers actually turned their cameras from the podium to snap shots of Moore and legions of reporters crowded around him. But, by the time McCain’s primetime speech came, Moore was listening intently and taking notes.

That did not mean, however, that he was an impartial reporter.

His observations about the convention were every bit as barbed as the themes he hit in “Fahrenheit 9-11.” Noting that most of the primetime speakers at the convention were “gay rights advocates and abortion rights advocates” who are at odds with the party’s platform and the positions taken by the Bush administration, such as former New York City Mayor Rudy Giuliani, who spoke last night, and California Governor Arnold Schwarzenegger, who will speak tonight. “There’s no way the Republicans can win if they are really themselves,” argued Moore.

A number of Republicans were themselves when they saw Moore had crashed their party.

“I got no use for the man at all — he’s the scum of the earth,” said Jimmy Gilbert, an alternate delegate from Lenoir, North Carolina, who followed Moore through the hallways of Madison Square Garden with a “Vive Bush” sign.

Diane Francis, a Texas Republican decked out in full jean shirt and cowboy hat regalia, grumbled about Moore’s movie and said, “I hope he’s got security. He could get killed in here.”

But Moore insisted that he did not feel threatened. “I saw (conservative commentator) Sean Hannity on the floor at the Democratic convention. He was treated well. I’m sure they’ll treat me well here. You don’t think the Republicans are more mean-spirited than the Democrats, do you?” asked Moore, barely concealing a grin.

Besides, he said, “This is a celebration.”

Referring to the coming election, Moore said, “I’m here to celebrate the fact that the Republicans only have a couple of months left. I’m here to celebrate the end of the Republican era. They’ve had four years. It’s been rough, but it’s almost over.”