"If we lose the vote on 42 days, there'll be trouble ahead," David Davis told a friend at the weekend. There certainly is now.
David Cameron had no inkling it was coming when he joined his shadow Home Secretary for a one-to-one meeting in the Shadow Cabinet Room just after MPs had voted narrowly to approve 42-day detention for suspected terrorists on Wednesday evening.
Mr Davis told the Tory leader his mind was made up: he would continue his personal crusade against "42 days" by resigning his parliamentary seat and fighting a campaign on the issue. A stunned Mr Cameron strongly opposed the move, warning Mr Davis it was "high risk". He knew a by-election would take some of the heat off a Brown Government in deep trouble and shift the media spotlight on to the Tories at a time when Mr Cameron was pursuing a "softly, softly" strategy, allowing Gordon Brown to stew in his own juice.
But Mr Davis's mind was made up. "It was a fait accompli," a Cameron aide said. Mr Cameron's mind turned to damage limitation.
The venue of their meeting was appropriate. The Shadow Cabinet Room, off a gloomy Commons corridor behind the Speaker's chair, has been the scene of several battles between the two men who were rivals for the Tory leadership three years ago. In it hangs a copy of a Van Dyke portrait of a brooding Charles I.
The issue was how the Tory Opposition should respond to Mr Brown's proposal to raise the 28-day maximum limit for which terrorist suspects should be held without charge.
Mr Cameron sensed a classic Brown trap, an attempt to put the Tories on the wrong side of the argument so Labour could portray them as "soft" on terrorism. But Mr Davis argued passionately that the Tories should stand up for civil liberties and that their stance should not be determined by short-term political considerations.
Mr Cameron needed some persuading to oppose 42-day detention. But Mr Davis worked hard at it. There are rumours he even threatened to resign from the Shadow Cabinet if the Tories did not oppose the proposal. "He had to stiffen Cameron's spine," one Davis ally said.
In an interview in January, Mr Davis acknowledged the split. "In truth, when we went down this very high-principled line ... inside the Tory party, inside the Shadow Cabinet, we've had debates about this, there have been colleagues who've said, 'this is a bit dangerous, you're taking a chance with public opinion'," he said.
Mr Davis prevailed. But only, it seemed, for the Commons decision. In recent weeks, Mr Cameron and several other shadow ministers have been "wobbling" over the Tories' existing line, nervous that Mr Brown's strategy would work if they continued their total opposition to 42-day detention after MPs had approved it. Their jitters were enhanced by opinion polls taken in the run-up to the Commons vote, all showing that public opinion was solidly with Mr Brown rather than Mr Cameron.
The doubters are believed to include George Osborne, the shadow Chancellor; Michael Gove, the education spokesman; Nick Herbert, the justice spokesman; and David Willetts, the skills spokesman. "Cameron has been wobbling," one Tory source said. "There has been a big debate among the Cameroons about whether to hold the line on 42 days as we get closer and closer to a general election."
Insiders insist there was no great row, more an underlying tension that was bound to explode in the near future. The questions include: should the Tories fight it tooth and nail in the Lords? Should they vote against it when it returned to the Commons if the Lords throw it out? Moreover, should an incoming Tory government repeal "42 days" if it is eventually approved by Parliament? Should the Tories promise something in a manifesto that a new prime minister might be reluctant to make one of his first acts, knowing that a terrorist attack could happen at any moment?
Mr Davis decided, spectacularly, to pre-empt these questions, even if it will almost certainly cost him the chance to defend his cherished freedoms as Home Secretary. "No one should underestimate how obsessed David is about the issue of civil liberties," one aide said. "He has given up the chance to become Home Secretary because of it."
Yesterday, some Tories painted him as a man with a big ego, and pointed to other tensions with the young hare who came from nowhere to overtake him when he was the front-runner to win the Tory leadership in 2005.
The Cameroons are cautious about demands from traditionalists to use the party's ascendancy in the opinion polls to win support from the voters by putting down more markers about what a Tory government would do – notably on tax cuts. Mr Davis is sympathetic to these calls.
Others say Mr Davis has had such an "adrenalin surge" from his stance against 42-days detention that he cannot bear to give it up. They suspect he wants to be remembered as a big figure and, despite holding a senior position in the Shadow Cabinet, feels marginalised by the inner circle of Cameroons who call the shots. They include Mr Osborne, Steve Hilton, Mr Cameron's strategy guru, and Andy Coulson, his communications chief.
There is also a feeling in Tory circles that, with the party riding high in the polls, Mr Cameron does not really need Mr Davis's support in the way he did a year ago when he was in trouble amid a Tory split over grammar schools. "Cameron needs Davis when he's down; he doesn't need him when he's up," said a Tory source.
Mr Brown could scarcely believe his good fortune when he was passed a note about Mr Davis's announcement during a meeting of Labour's national executive committee. In the short term at least, many Tories fear Mr Davis has thrown a lifeline to Mr Brown, the architect of 42-day detention. He will now try to prove his Tory critics wrong.