BEFORE he took office, Barack Obama's advisers suggested his rescue plan for the American economy would sail through Congress on fair winds, attracting substantial bipartisan support, if not quite reaching consensus. The number they dreamed up was 80 Senate votes - every Democrat and every other Republican. After a week in which his legislative agenda came under sustained attack from both sides, the president will be content to see his stimulus bill scrape through, diminished and shop-worn, by the narrowest possible margin.

As momentum stalled, Obama made an emotional appeal to "set aside some of the gamesmanship in this town and get something done".

The deal that senators finally arrived at, late on Friday night, was a classic Washington compromise of favours traded, credit taken and blame assigned. It will have to do.

It was not the stimulus package Obama wanted and bore little resemblance to the bill which arrived from the House Of Representatives, laden with giveaways to the Democratic Party's base. Republican Senator Kit Bond said there were so many obvious targets that he felt like "a mosquito in a nudist colony".

Together with the fiscally conservative "Blue Dog" Democrats, he and his colleagues bit almost $100 billion from the proposal, drastically cutting spending on education and school buildings, limiting the funds that will be parcelled out to individual states and reducing allocations across the board.

Republican intransigence, allied to the executive's inability to sell the bill, empowered a group of centrist senators, led by Democrat Ben Nelson and Republican Susan Collins. Olympia Snowe and Arlen Specter said they will also cross the aisle when the Senate votes, tomorrow or on Tuesday. Majority leader Harry Reid hinted that although negotiations will continue all weekend, the basic outline of a filibuster-proof agreement has been reached.

As John McCain predictably condemned the bill as too much spending, too few tax cuts, Nelson boasted on the Senate floor: "We trimmed the fat, fried the bacon and milked the sacred cows."

They were able to do so because Obama's team had lost control of the debate. Republicans outnumbered Democrats on the cable news channels two to one. References to "pork" - the pejorative term for wasteful spending - quadrupled from one week to the next on politics websites.

The new Republican National Committee chairman Michael Steele somehow got away with saying that "not in the history of mankind has the government ever created a job" without being widely ridiculed.

Democrats complained that Republicans were trying to define the bill by focusing on marginal spending programmes such as $75 million for "smoking cessation activities" and $88 million for new polar icebreakers, but their efforts to fight back were ineffective. The latest CBS poll showed a clear erosion of support, down 12% since mid-January. Obama's plan is still backed by the majority of Americans, but only just.

The Grand Old Party's renewed confidence was underscored by an alternative stimulus plan introduced by Senator Jim DeMint of South Carolina that consisted exclusively of tax cuts, including permanent repeal of the death tax for estates worth less than $5 million, reducing capital gains tax to 15% and cutting the corporate tax rate to 25%. It was defeated 61 to 36 but the fact that it was even raised showed how far the parameters had shifted.

Republicans took advantage of the administration's first moment of vulnerability. On the day that Obama prepared to go on the offensive in a series of television interviews, Tom Daschle shoved him on to the ropes. Daschle's withdrawal from two top jobs - he had been chosen to lead both the White House Office of Health Care and the Department of Health and Human Services - turned Oval Office chats with NBC, ABC, CBS, CNN and Fox News into an orchestrated apology in five acts.

"I screwed up," Obama told the networks. "I consider this a mistake on my part We can't send a message to the American people that we've got two sets of rules - one for prominent people and one for ordinary people."

Ostensibly, Daschle pulled out because, like new Treasury Secretary Tim Geithner, he didn't pay his taxes. It may even be true that if the confirmation hearings had been in a different order, he would have survived and Geithner would have been undone by his failure to make Social Security contributions in the years he worked for the International Monetary Fund. It was certainly bad luck to be under scrutiny as yet another appointee, chief performance officer Nancy Killefer, was drummed out for sins of accountancy.

Daschle owed the most money. But the main reason he had to go was that his misdemeanour - carelessly dismissing a free limousine and driver as "a gift from a good friend" - painted such a caricature of Washington entitlement and graft. As a taxable benefit it was worth $255,000. As a symbol of Obama's failure to put a wedge in the capital's revolving door it could not have been more potent. An editorial in the Charlotte Observer summed it up as "change we cannot and do not believe in".

Until Tuesday, the president stood by his friend "absolutely" in the face of trenchant criticism. This was the mistake he apologised for, not the fact that he chose Daschle in the first place. Obama had already made an exception to his heralded ethics legislation once, for former arms industry lobbyist William Lynn, so Daschle's established relationships with drug companies and hospitals were presented as a plus, rather than a potential liability.

The New York Times described him as "another in a long line of politicians who move cozily between government and industry". Rolling Stone's political reporter Matt Taibbi went further. "In Washington there are whores and there are whores, and then there is Tom Daschle," he wrote. "In picking Daschle - who as an adviser to the K Street law firm Alston and Bird has spent the last four years burning up the sheets with the nation's fattest insurance and pharmaceutical interests - Obama is essentially announcing that he has no intention of seriously reforming the health care industry."

Daschle earned more than $5 million in the last two years alone, as a consultant to lawyers specialising in health care issues and a board member at the Mayo Clinic. His wife, Linda Hall, used her extensive contacts at the Federal Aviation Authority to become one of the industry's top lobbyists, working for Boeing, Lockheed Martin and American Airlines, among others.

One could pick a speech almost at random from Obama's back catalogue to illustrate the hypocrisy of appointing Daschle, but his very first statement as a presidential candidate takes some beating. On the steps of the state capitol, in Springfield, Illinois, he promised to take on "the cynics, and the lobbyists, and the special interests who've turned our government into a game only they can afford to play".

"They write the checks and you get stuck with the bills," he said. "They get the access while you get to write a letter, they think they own this government, but we're here today to take it back."

During the campaign, he revisited this theme so often that, more than any other, it came to define his candidacy. How could his advisers - the famously disciplined "no drama Obama" team - have failed to spot that picking Daschle undermined this core message?

From the wreckage, they spun it as a salutary lesson. "People like the fact that he said he made a mistake," his Chief of Staff Rahm Emanuel told reporters. "They hadn't heard it from anybody in office for a long time. They heard excuses and denials." Which is true, in that George Bush and Bill Clinton were both notoriously loath to own up to errors, but hardly restores Obama's brand to its former lustre.

Having done his public penance, the president unapologetically sought to wrest control of the stimulus debate from Republicans. At his next White House press conference he warned that "a failure to act, and act now, will turn crisis into a catastrophe".

In Thursday's Washington Post, he submitted a column attacking "the notion that tax cuts alone will solve all our problems". In doing so, he explicitly cashed a chunk of his electoral capital. "I reject these theories, and so did the American people when they went to the polls in November and voted resoundingly for change," he wrote.

This was an abrupt change of tack, away from conciliatory statements and bipartisan meetings. As negotiations over the bill's contents dragged on, Obama became visibly frustrated, lecturing the hold-outs that "it is inexcusable and irresponsible to get bogged down in distraction and delay while millions of Americans are being put out of work". Until Friday morning, when January's dire unemployment figures showed 600,000 more jobs lost these efforts failed to inject any sense of urgency into proceedings.

In his weekly address, posted online early on Saturday morning, Obama again took aim at conservative orthodoxy, but in truth, he has been forced to make significant concessions to it, adjusting the balance between spending and tax cuts to push the legislation through. House Democrats will tug him in the other direction when the bill returns there next week.

It was a rough week, with the promise of more troubles to come. Ted Kennedy was summoned from his sickbed to cast what could turn out to be the deciding vote. He cannot be relied upon for much longer.

Dick Cheney popped up, taking evident delight in the administration's struggles, to warn that there is a "high probability" of a nuclear or biological attack that "would involve the deaths of perhaps hundreds of thousands of people," and that the threat will increase if Obama closes Guantanamo.

The news that Justice Ruth Bader Ginsburg had returned to hospital for surgery to combat pancreatic cancer was a reminder that the three Supreme Court judges most likely to retire are all members of the liberal minority.

Four of the five most conservative justices in the court's history are currently serving, so Obama will need to appoint from the left simply to maintain the ideological balance. Those confirmation hearings suddenly look tricky.

Click here to comment on this story...