Still, Democrats were stunned one Saturday in late March when, by their account, John Weaver, Mr. McCain’s longtime political strategist, reached out to Thomas J. Downey, a former Democratic congressman from Long Island who had become a lobbyist with powerful connections on Capitol Hill. In Mr. Downey’s telling, Mr. Weaver posed a question to him over lunch that left him stunned.

“He says, ‘John McCain is wondering why nobody’s ever approached him about switching parties, or becoming an independent and allying himself with the Democrats,’ ” Mr. Downey said in a recent interview. “My reaction was, ‘When I leave this lunch, your boss will be called by anybody you want him to be called by in the United States Senate.’ ”

Mr. Weaver recalls the conversation differently. He said that Mr. Downey had told him that Democrats, eager to find a Republican who would switch sides and give them control of the evenly divided Senate, had approached some Republican senators about making the jump. “I stated they couldn’t be so desperate as they hadn’t reached out to McCain,” Mr. Weaver said in an e-mail message last week.

Whatever transpired, Mr. Downey raced home and immediately called Mr. Daschle. It was the first step in what became weeks of conversations that April between Mr. McCain and the leading Democrats, among them Senator Edward M. Kennedy of Massachusetts and John Edwards, then a senator from North Carolina, about the possibility of Mr. McCain’s leaving his party. One factor driving Mr. McCain, Mr. Downey said, was his bad relations with the Republican caucus.

“They had booed him once when he came in,” Mr. Downey said. “It was bad stuff in the caucus. He didn’t see his future with these guys.”

Mark Salter, one of Mr. McCain’s closest advisers, said that Mr. McCain, although flattered, never took the idea of leaving the party seriously. The topic was in any case overtaken in May when Senator James M. Jeffords of Vermont abandoned the Republicans and changed the balance of power. By June, when Mr. Daschle spent a long-planned weekend with Mr. McCain at Mr. McCain’s Arizona ranch, the question of changing parties was moot.

But less than three years later, Mr. McCain was once again in talks with the Democrats, this time over whether he would be Mr. Kerry’s running mate. In an interview with a blog last year, Mr. Kerry said that the initial idea had come from Mr. McCain’s side, as had happened in 2001.