Can Procter & Gamble CEO Bob McDonald hang on?

CEO Bob McDonald, pictured in 2009, has bought himself some time but still faces intense pressure.

FORTUNE — Earnings calls aren’t known for providing catharsis. Indeed, you wouldn’t have detected elation in the nasal, Midwestern tones of Procter & Gamble’s embattled CEO, Bob McDonald, as he answered questions after the ritual presentation of the quarterly numbers on Jan. 25.

Still, you couldn’t escape the sweet, unclenching feeling of relief as executives announced results that smashed analysts’ expectations. P&G’s “core” earnings per share had jumped 12%, while sales less one-time items rose 3%. Take that, critics! Sure enough, P&G’s stock PG quickly soared to an all-time high. (More on that a bit later.)

Not so long ago, this would have been just another stellar day at P&G, the maker of such consumer stalwarts as Pampers, Tide, Downy, and Crest. This, after all, is one of America’s great enterprises, an icon that, aside from the occasional fallow period, has thrived for 175 years. P&G has long been admired for its superior products, its marketing brilliance, and the intense loyalty of employees, dubbed, with a mixture of respect and irritation, Proctoids. With 25 brands that generate more than $1 billion in sales, Procter & Gamble is the largest consumer goods company in the world.

Yet the past several years have been a struggle, as the company’s vaunted innovation machine clanged to a halt, recession-battered consumers abandoned P&G’s premium-priced products for cheaper alternatives, and efforts to build market share in the developing world were stymied by newly nimble rivals such as Unilever UL.

Consider this: When McDonald took over as CEO in July 2009, P&G’s annual revenue was $75 billion. He boldly told employees that the company would crank that up to $102 billion by 2013. So what did it actually deliver last year? A comparatively paltry $83.7 billion in revenue. The real disaster was P&G’s net income, which has dropped 20%.

By its low point in June, P&G was losing share in two-thirds of its markets. A sense of vulnerability and insecurity crept into the ranks of longtime employees and alumni, who wondered whether the company had lost its edge. Many questioned McDonald’s fitness for the job.

Now there are signs that the company is emerging from its funk with a shift driven by a $10 billion cost-cutting plan and a promise to create, in McDonald’s words, a “culture of productivity.” In June he unveiled what he calls “40/20/10,” which is narrowing P&G’s focus to its 40 biggest “category/country combinations” (such as laundry in China), its 20 largest innovations, and its 10 most lucrative developing markets. The company vows that blockbuster new products are imminent.

The changes are, by McDonald’s own admission, late in coming. “As I look back,” he says in one of three interviews he has given Fortune in recent months, “I wish I’d had the benefit of hindsight and done the things we’ve done recently earlier.” But now, he says, the company is back on track, adding, “I’m really energized.”

Yet it’s too early to declare a renaissance at P&G. Let’s start with the recent numbers. Beating projections is fantastic. It helps explain the stock’s recent tear, as does the market’s rollicking January, and the fact that, as we’ll see, activist investor Bill Ackman has been agitating for change. But it’s a lot easier to beat expectations when you’ve previously lowered those targets, as P&G did. (Despite the stock’s recent spike, P&G shares have trailed those of its rivals during McDonald’s tenure.)

P&G’s woes have eroded morale. Many top people have retired early or bolted to competitors. Others still plan to leave, according to a just-released survey of company alumni and a top headhunter, who reports receiving a steady stream of P&G résumés. Says Ed Artzt, P&G’s CEO from 1990 to 1995: “The most unfortunate aspect of this whole thing is the brain drain. The loss of good people is almost irreparable when you depend on promotion from within to continue building the company.” P&G counters that its own data, which it shared with Fortune, show that turnover is at average levels. The company insists it hasn’t lost any top people it wanted to keep.

Interviews with 31 current and former senior-level executives reveal a schism between those who support McDonald and those who believe he can’t regain the credibility he has lost. What’s needed, they say, is radical change, not just modest restructuring. That could take years — but Wall Street is impatient for results now, and McDonald’s job depends on delivering them. What that means is a struggle is under way for the soul of P&G. Says senior analyst Ali Dibadj of Sanford Bernstein: “The next six months may be the most crucial in P&G’s 175-year history.”

When McDonald took the helm on July 1, 2009, it was a classic P&G moment: The carefully orchestrated transfer of power to a longtime company man. McDonald, now 59, had joined P&G in 1980 and worked his way up through posts in Canada, Japan, the Philippines, and Belgium to become chief operating officer.

A West Point graduate and onetime Army Ranger, McDonald has the disciplined, methodical cast of mind you might expect from a military man. But he’s more in the modern image of a soldier/theorist than the bombastic Pattonesque stereotype of yore. He’s a longtime student of leadership who teaches in P&G’s executive development program.

In person, McDonald is earnest and friendly — he remembers names and likes to lunch with lower-level employees at every stop he makes around the world — yet a bit uncomfortable. His leadership feels more studied than innate. You can sense the intense will that he has channeled into constructing himself.

At heart, McDonald is an engineer. He majored in the subject at West Point, and he’s fanatical about processes. He’s efficient, answering e-mails almost instantly no matter where in the world he is, and keeps his desk eerily clean; there typically isn’t a sheet of paper on it.

As a new CEO, McDonald faced an extraordinary challenge. Not only was he taking on the mantle of one of the biggest companies in the world, but he also had to succeed a legend, A.G. Lafley, a hero both in Cincinnati and in the corporate world. Lafley resurrected P&G after its last major downturn, inspiring Harvard Business School case studies and a glowing documentary. He electrified a then-demoralized organization and shepherded products such as Swiffer and Febreze to megahit status. Lafley relaunched Olay, a faded skin-care brand, as a high-end product and quickly added more than $1 billion in sales. His crowning move was to buy Gillette for $53.4 billion in 2005, giving P&G a major presence in the men’s market for the first time.

McDonald not only had to follow Lafley but had to do so during a calamitous recession. Worse, for all of Lafley’s triumphs, hints of corporate dry rot had appeared during his final years. There seemed to be ever fewer hits in the development pipeline that McDonald would inherit. After 2006 most growth came from line extensions of existing brands or from acquisitions. Lafley’s “connect and develop” program, which relied on partnerships with outsiders to bring in new, marketable ideas, saved money but stopped delivering blockbusters.

McDonald’s first push as CEO was to expand P&G’s operations in emerging markets. The company obtained 32% of sales in such economies at the time, compared with about half for rivals Unilever and Colgate-Palmolive CL. With their exploding middle class, those markets were a natural focus.

It wasn’t easy, though. P&G made progress in places like China and Russia but struggled elsewhere. As that was happening, the company was caught flat-footed by forces that buffeted its businesses in developed markets. Commodity prices were surging, and P&G’s products had become too expensive for burdened middle-class consumers. Focused on emerging markets, McDonald had little time or resources, say former executives, for the core developed markets — the ones that drive the company’s earnings. The U.S. beauty business, the symbol of P&G’s renaissance under Lafley and the source of more than a third of earnings, stagnated. For example, hair-care brand Pantene’s U.S. market share sagged from 17.3% in 2009 to 13.8% at the end of 2012, according to A.C. Nielsen. P&G’s portion of the U.S. laundry market fell 2.1 percentage points from 2008 to 2011. Meanwhile, some P&Gers worried that Lafley had overpaid for Gillette. The razor giant depended on persuading customers to periodically trade up to the next level of razor — a difficult proposition when times are tough.

P&G resisted cutting prices for products such as Tide, in part because of the need to fund its massive developing- markets play. The company had high overhead, which made it even more reluctant to trim the prices it charged. McDonald and P&G were being squeezed from all sides.

One problem was that it was hard to discern McDonald’s priorities. He seemed to want to launch every product line in every emerging market at the same time and support units in established markets. His priority appeared to be everything, which is to say, nothing. Says analyst Dibadj: “The strategic problem was that they decided to go after everybody. But they ran out of ammo too quickly.”

There was a parallel issue. McDonald’s predecessor, Lafley, had always had a clear strategy: “The consumer is boss.” That sounds almost childishly obvious. But the maxim translated into a practical focus: What matters are the “two moments of truth” — when a consumer first sees a product in the store, and when he first uses it at home. Every decision was to be viewed through this lens.

McDonald replaced Lafley’s strategy with a new vision called “purpose-inspired growth,” or, as he put it to anyone who asked, “touching and improving more consumers’ lives, in more parts of the world, more completely.” He espoused the concept with messianic zeal.

In developing markets, purpose was meant to instill pride. Employees were selling not just soap, but cleanliness itself. Diapers, the theory went, would let babies and parents sleep through the night, thereby transforming the earning power of a lower-middle-class family.

“Purpose” was an undeniably laudable ambition (and Fortune praised it in 2009). But many P&G employees simply couldn’t fathom how to translate the rhetoric into action. Says Dick Antoine, P&G’s head of HR from 1998 to 2008: “ ‘Purpose-inspired growth’ is a wonderful slogan, but it doesn’t help allocate assets.”

McDonald himself seemed more comfortable engaging on a broad or abstract level — more like a chairman than a CEO. He was thrilled to participate in policy discussions at think tanks, according to former executives, but less interested in digging into the nitty-gritty of a troubled unit. He maintained a punishing travel schedule, which included commitments to at least 18 outside organizations at various times, such as the board of Xerox XRX, the U.S.-China Business Council, and the Business Round table, as well as personal interests, such as chairing the board of visitors at Duke University’s Fuqua School of Business (his two children are Duke alums). He spoke regularly to colleges and trade groups.

Then there was McDonald’s obsession with process and efficiency, a cure that occasionally seemed worse than the disease. He pushed the company to introduce a web “cockpit” that delivered almost minute-by-minute sales data. It was useful, but some employees felt as though they spent more time inputting data into the system than they saved by using it.

McDonald authorized an efficiency study that assessed every act and function performed by every employee and then reduced the number of “business processes” needed to run the company to 88. Says Sonsoles Gonzalez, a former general manager for Pantene who left in 2011: “There was lots and lots of measuring for the purpose of promoting productivity, but it resulted in too many internal transactions and negotiations and had less to do with winning the consumer.”

Perhaps the biggest stumbling block of all couldn’t entirely be laid at McDonald’s feet. Lafley had installed a complex “matrix” organizational system that shared power among executives in charge of functions such as HR, marketing, and finance; executives overseeing geographic regions; and executives for product categories such as beauty care. The groups served as checks and balances on one another; no one person or group had complete responsibility for any product or area. But under McDonald the system grew more cumbersome, in part because the likes of HR and marketing became more powerful. Brand and country managers felt they were losing influence. Decision-making was bogging down just as social media and other trends accelerated the pace at which customer tastes change.

If employees disagreed on something as simple as how many languages should appear on the bottle of a new shampoo, they were expected to consult books of “PACE models” (in P&G lingo: Process owner, Approver, Contributor, Executor) to clarify who had authority in various instances. Process itself was threatening to become more important than conceiving great products and selling them.

As frustration began to mount with these systems, then later with McDonald himself, an exodus started. In the beauty business alone, more than 15 senior executives departed. Other divisions suffered outflows too.

P&G has had to compete with its own alums as CEOs at Unilever, where Paul Polman has excelled, and Estée Lauder, which has flourished under Fabrizio Freda. Others who departed for CEO positions include Ed Shirley, now at Bacardi; Chris de Lapuente, at Sephora; and Chip Bergh, at Levi Strauss.

P&G says turnover hasn’t increased. “Every company has leaders leave for various reasons,” says human resources chief Mark Biegger. “Our attrition rates remain low and constant.” The breadth of P&G’s talent, he adds, has always made it a training ground for executives who go on to head other companies.

In the first half of 2012, P&G’s problems became increasingly visible. Known for reliable performance, P&G was forced to lower its profit guidance three times in six months, frustrating analysts and investors alike. Even though the company announced a $10 billion restructuring plan centered on 5,700 job cuts, skepticism kept the stock far below its 2007 highs.

Further complicating matters for McDonald was a vocal alumni group. P&G’s glorious history and its culture have fostered fervent loyalists. People view themselves as P&Gers for life. Their ties are intensified by the fact that P&G pays its North American retirees’ pensions primarily in company stock. When things go wrong, the company takes a beating not only from Wall Street investors but also from thousands of retirees.

One of the most vocal critics was Gary Martin, a retired head of family care. In April he penned a letter to lead director James McNerney, first reported in the Wall Street Journal, that he said had the blessing of many current and former P&Gers. “The facts are the facts,” it read. “No new major product success in more than 10 years, consistently disappointing financial performance … worst in class stock growth, and serious unrest among the executive community, both current and retired.” The 13-page letter charged that the board wasn’t “receiving a complete and accurate assessment” of the situation from the CEO.

Martin wanted to talk to the board about McDonald. But before he even sent his letter, he tells Fortune, McDonald got wind of the plan and swooped in. The two met and, according to Martin, the CEO read from prepared notes and refused to address criticisms directly. Martin says the board sent him a terse letter but declined to meet with him. “I was so frustrated because I wanted the board to engage,” Martin says. “They just blew me off.” (P&G declines to comment.)

That spring, the results from P&G’s annual employee survey arrived. Overall numbers were flat, but the questions relating to confidence in business-unit leaders had fallen six percentage points. There was also negative feedback when Moheet Nagrath, then head of global HR, canvassed the top 40-odd executives as part of McDonald’s performance review. For the first time in three years, the findings weren’t discussed publicly at the annual offsite meeting of the top leaders in July. “It was not presented because we wanted to spend time on the common goals,” Nagrath says.

The drama escalated into a public brawl on July 12, when the brash activist investor Bill Ackman of Pershing Square Capital revealed that he had accumulated P&G shares worth $1.8 billion — only about 1% of the float, but enough to send a shiver down the spine of everyone on the executive floor at P&G. Ackman’s announcements, which frequently call for change in management or the board, often move the market, and the stock rose 6% within days.

The business press began buzzing that McDonald would be ousted and speculating as to who might replace him. Six days later P&G’s board publicly endorsed the CEO.

Still, the pressure was building. In August, McDonald lost a key ally and one of his closest friends at P&G when HR chief Nagrath, who occupied the office next door, unexpectedly announced he was stepping down. The company didn’t issue a press release. (Nagrath says he left to teach and consult.)

On Sept. 4, Ackman met with McDonald and two directors, McNerney, CEO of Boeing BA, and Kenneth Chenault, CEO of American Express AXP. He presented a 75-page critique that laid out the company’s strategic missteps and underperformance, and concluded that P&G needed a new leader. (A more oblique thumbs-down came from Warren Buffett, a longtime shareholder who reduced Berkshire Hathaway’s brk.a stake by 11% not long after McDonald visited Omaha.)

News of the Ackman meeting leaked out in late September, prompting P&G’s board to issue a new statement asserting that it “wholeheartedly” supported the beleaguered CEO. (The directors declined to speak with Fortune but reiterated their backing for McDonald in a written statement that noted they were “encouraged” by the company’s recent performance.)

Certainly, the board has had plenty of its own distractions. Start with Meg Whitman, whose struggles at her own company, Hewlett-Packard HPQ, have been well documented. She replaced onetime McKinsey head Rajat Gupta, who resigned from the board in March 2011 and is appealing a conviction for insider trading. Angela Braly was the CEO of WellPoint WLP until she was forced out in August after a turbulent year. More recently, McNerney, P&G’s lead director, has had to fend off a crisis as Boeing’s most important airplane, the Dreamliner, was grounded indefinitely after a series of malfunctions.

McDonald has worked over the past months not only to hone his strategy, but also to cultivate the broader P&G community. He has welcomed input from other executives, such as Artzt, who says he’s cheered by the company’s recent progress. “I believe that Bob has taken to heart the suggestions we gave him,” Artzt says. McDonald invited Artzt and his fellow former CEOs Lafley and John Pepper to speak at the annual senior leadership meeting in October. The “three tenors” shared their own experiences dealing with difficult times. McDonald said little, apparently as absorbed with learning the lessons as anyone else in the room. But he seems to have been galvanized by the pressure. Citi analyst Wendy Nicholson, who rates P&G’s stock a “buy,” says he acts “like someone who has looked death in the eyes.” McDonald no longer proselytizes about “purpose” these days. He hasn’t uttered the word once in the last two earnings calls.

McDonald has been particularly active in recent months. He announced an aggressive stock buyback a few months after opposing such a move, provided more details on the 40/20/10 plan first mentioned in June, and recentralized innovation efforts under one executive. He also named another longtime P&Ger to head a new council focused on creating a “culture of productivity” and announced a second round of layoffs that will eliminate 2% to 4% of employees each year through fiscal 2016. McDonald has cut his outside affiliations to six. “You have to give people credit for recognizing that they need to make some adjustments,” says Gil Cloyd, P&G’s former chief technology officer.

Those actions — and more important, the company’s recent results, including a hit line extension for Tide detergent packaged in “pods” — have eased the pressure on McDonald as critics wait to see whether the company can sustain its improvements.

Still, it won’t take much to return Ackman to battle mode. “We’re delighted to see the company’s made some progress,” he says. “But P&G deserves to be led by one of the best CEOs in the world. We don’t think Bob McDonald meets that standard.” Ackman says he hasn’t decided his next move, but he expects to hear more from P&G in mid-February about a company reorganization.

McDonald bristles at the notion that Ackman is influencing the agenda. “I don’t need people around me to exert pressure on me,” he says. “I exert enough pressure on myself as CEO of one of the greatest companies in the world.”

McDonald still has plenty to do. P&G’s cost-cutting, for example, is commendable but not appreciably different from what its rivals are doing. Some critics believe P&G needs to overhaul its entire structure. They argue that it must return some power to the brands — P&G’s heart and soul — and give employees more ownership over the products they create and sell. “The organizational structure may not be right for today,” says former P&G CMO Jim Stengel. “It’s complex, and over the years they have added many new brands and categories. Accountability has become more diffuse.”

McDonald says a council of top leaders is examining the structure, and changes are on the horizon. But will the CEO be willing to undertake real organizational transformation, which can depress short-term profits, at the very moment that Wall Street is clamoring for better earnings?

P&G’s problems remain serious. The company says it’s now holding or gaining share in “nearly” 50% of markets. That’s an improvement, but it still means P&G is losing share in more than half its markets.

Paradoxically, P&G’s high costs mean the company can achieve increased earnings with some basic cost-cutting. But its growth rates remain anemic compared with those of rivals. Unilever enjoyed an 8.6% sales increase, vs. 2% (unadjusted) for P&G in its most recent quarter. “The relative growth gap is still pretty wide and, in many cases, widening,” says UBS analyst Nik Modi, who adds, “P&G isn’t too big to grow. It’s too complicated to grow.”

The company’s travails have harmed its reputation. For years, P&G simply obliterated the competition when it came to nurturing relationships with the chains that sell its products. The 2012 Kantar retail PoweRanking survey, in which retailers rate their suppliers, ranked P&G as No. 1 for the 10th year in a row. Yet for the sixth straight year the company showed deterioration in almost every category. P&G’s ranking dropped 6.1 percentage points in the overall score from 2011 alone. Says Citi’s Nicholson: “According to this data, Procter’s trends look awful.”

The P&G community remains dubious about the current regime. According to a survey of alumni released by Bernstein in January, 54% rated senior management as fair or poor, and 70% said that at least 20% of their friends were actively trying to leave P&G. McDonald counters that the Bernstein sample is so small as to be meaningless and says P&G’s research shows that pride in the company is at 84%.

Inside the company, gossip continues about who might replace McDonald. The CEO does retain the support of prominent former CEOs such as Lafley and Pepper. “I still have total confidence in Bob,” Lafley says, adding, “The most growthful times in my life were when the stress was highest and the cliff was the widest. So if you believe in the crucible of the marketplace and competition, this is a great time for Bob McDonald.” One can only hope, for McDonald’s sake and that of P&G, that the times don’t get any greater.