The White House narrative on how the country lost its triple-A rating and began a descent toward Third World status goes something like this:

Standard & Poors woke up Friday morning and out of the blue decided to downgrade Uncle Sam’s debt despite the administration’s best efforts to show the wrong-headedness of the S&P analysis.

Don’t buy it.

Yes, last Friday saw lots of meetings in Washington with Treasury Secretary Tim Geithner & Co. haranguing S&P executives with phony evidence that they’re getting a handle on the nation’s $14 trillion and rising debt, and the rotten economy that has squeezed tax revenues. But the fact remains, federal debt is set to grow for the foreseeable future, even with the spending cuts imposed in the recent debt-ceiling deal.

More important, the downgrade should hardly have been a surprise for the administration — it was among the most telegraphed in the history of downgrades.

The Obama Treasury Department had been on thin ice with the ratings agencies — companies that offer opinions to investors on the safety and soundness of debt both public and private — for at least a year. And the failure of Obama’s near-$1 trillion stimulus package was among the chief culprits for the downgrade.

Without the job growth the president and his economic team had promised from the stimulus, tax revenues would remain weak — and with Team Obama planning to keep on spending, the nation would have no choice but to add to its growing mountain of debt to make up the difference.

The ice got considerably thinner in the early spring when raters, in meetings with White House financial officials, found the Obama team unwilling to face the facts of the nation’s deteriorating finances. It got even thinner during the weeks of the debt-ceiling debate — when S&P told anyone with a heartbeat on Capital Hill and at Treasury the country’s triple-A was in jeopardy.

So the final straw came Friday — and only after the S&P spent the last week or so handwringing about what to do, factoring into its equation the much-heralded debt deal, which (the S&P wonks concluded) had done little to dent the feds’ massive-and-rising”-”as-far-as-the-eye-can-see debt load.

Coupled with the likely prospect of prolonged 9 percent unemployment and weak GDP growth — that seemed to leave S&P no choice but to downgrade.

The decision certainly didn’t come easy for the rating agency. I’m told there was a fierce internal debate: Since the other two rating agencies had maintained their triple-A assessments, S&P would be an outlier and a target for reprisals from the administration and its political allies. But in the end, the corporate bureaucrats at S&P decided their credibility was at stake.

In a sense, the company had boxed itself in, issuing statements during the debt-ceiling fight that it wouldn’t be satisfied unless $4 trillion was cut from the budget. If it backed down after the final deal far short of achieving those savings, why would traders and investors ever listen to anything the company ever said again?

It picked Friday as the day to alert the administration that the downgrade was coming as a favor: It gave the Obama crew one last chance to provide evidence they’re getting a handle on the deteriorating economy and gave the markets two full days to prepare for the downgrade’s potentially devastating impact.

But all Geithner & Co. could come up with was some bickering about math, claiming S&P’s analysis somehow overlooked $2 trillion in revenues. Right or wrong, that didn’t come close to touching the big-picture issues that were at the heart of the downgrade.

Wall Street is used to turmoil, and every major firm held meetings all weekend to get set for today’s opening. There’s no agreement on what to expect, beyond a sharp decline in stocks at the opening bell.

“The bottom line, no one really knows,” said William Heinzerling, head of fixed income at Stifel Nicolaus and a veteran bond trader. “We are in truly uncharted territory.”