In the end, it must have been the polls.

For weeks, CBS's David Letterman has been badgering Hillary Rodham Clinton to join him on the "Late Show." He called her staff "pinheads" and her PR man a "weasel" and a "pantywaist." He noted that the president "no longer sleeps alone" since she moved to Westchester. He made fun of her legal woes and her overtures to Jews. "I've been imploring, beseeching, browbeating, taunting the first lady," Letterman said in his monologue tonight. But she wouldn't budge.

Then came the poll. The Marist poll of 621 registered New York voters found that, by a margin of 58 percent to 24 percent, New Yorkers believed that Clinton should accept Letterman's invitation. Clearly, she had no choice. The poll was completed Monday. She announced her acceptance Tuesday. And tonight, she pulled up at the "Late Show" studios at Broadway and West 53rd Street, accompanied by a 10-vehicle motorcade--and joined by her pollster.

The event itself went far more smoothly for Clinton than the buildup. Letterman, warned at the start by Walter Cronkite to "try not to be a jackass," was gentle on his guest, and Clinton was a hit. Dressed in a dark pantsuit and peach blouse, she looked at ease and exchanged crisp one-liners with Letterman for 20 minutes. She entered to Billy Joel's "New York State of Mind" and finished to the chords of "New York, New York" and "God Bless America," as Letterman presented her with a riding lawn mower for her new home in Chappaqua.

Clinton passed with finesse a pop quiz about New York's fauna, flora, topography and geography, and she edged ever closer to her announcement. "I am going to run for the Senate," she said, but then qualified this seeming declaration with, "and I am officially going to declare" sometime next month.

Her best moments, though, were her quick replies to Letterman's provocations. When the host wondered why she'd agree to appear on his show after all the abuse he'd hurled at her, she parroted the line Letterman had used to taunt her on an earlier show: "I knew if I were going to run for the Senate I would have to sit in this chair and talk to the big guy."

When Letterman noted that "every idiot in the area is going to drive by honking" outside the Clintons' Westchester home, she replied: "Was that you?" And when Letterman noted that the president seemed "standoffish" when they met, she responded, "He was just so curious as to why you've never made a joke about him."

True, she let fly a clunker or two, mentioning how the "satellite truck ran over the welcome wagon" at her new home. The line fell flat, and Letterman responded, "Somebody's been writing material for you, have they?" Clinton also displayed her political side, refusing to say whether she'd cheer for the Yankees over the Cubs. But she finished strong with her own top 10 list of reasons she decided to do the show. They included "Number 8: If Dan Quayle did it, how hard could it be?," "Number 4: "When they threw in a 'Late Show' tote bag, I said, 'Gas up the Taurus, Bill, we're goin' to Dave's.' "

The appearance must have been a great relief for Clinton, coming as it did at this low point in her campaign. The same Marist poll that demanded her appearance on "Letterman" also found that she hadn't made a dent in Rudy Giuliani's nine-point lead; Clinton has been down since last March. Worse, Giuliani is even with her among women, and slightly ahead among Jews. And fully 80 percent of New Yorkers see right through her little ruse: They believe she moved to New York just to run for the Senate. Still, that didn't stop Clinton, on the "Late Show," from citing Bobby Kennedy and claiming she's moving because "I wanted to live in New York."

Clinton clearly has had difficulty here, and not just because of that unfortunate episode with Mrs. Arafat or that little matter of the Puerto Rican terrorists. At the moment, she's getting criticism for pandering to New York's many special interests--one day the teachers, one day the Jews, one day the African Americans. Tuesday she even executed the rarely attempted dairy pander. Buying some low-fat cheese in Rochester, she declared: "I'm a cheese person."

But if she's been pandering lately, Clinton's "Late Show" appearance proved she hasn't lost her ability to attack. She took a whack at Giuliani, noting tartly: "Being a senator, you can't go arrest a homeless person." The applause was scant, but she got a better response after Letterman mentioned that Rep. Dan Burton (R-Ind.) wanted to call a 6-year-old Cuban boy before his committee. "You know, Dan Burton subpoenas everybody--mass subpoenas," said Clinton, whose friends and colleagues have received a good many of them.

Outside the studio, 40 photographers and journalists crowded around police barricades to get a glimpse of Clinton. Scores of passers-by waited for a sighting. "This is gonna be huge for her," said Paul Marks, a Letterman fan in a Mets cap who came for a peek. Shortly before the first lady left the studio, a man in a bathrobe--Letterman's "Turkish guy"--emerged from the building, smoking a cigarette, and pronounced Clinton "very attractive."

But then, the late-night fun was over, and it was time for business. A minute before Clinton left the studio, her pollster, Mark Penn, materialized, and hopped into the van waiting for her. The first lady herself emerged from the studio beaming, pronouncing the whole thing "wonderful." Somebody in the crowd shouted "Go home!" but Clinton didn't appear to notice. She climbed into the van with her pollster, and the motorcade disappeared up 53rd Street.

CAPTION: Nagged onto his show by David Letterman, Hillary Clinton gave as good as she got.

CAPTION: Despite David Letterman's taunts, the first lady cheerfully arrives for her "Late Show" taping.