FORTUNE -- In May 2010, Sara Lee CEO Brenda Barnes was at a Tuesday-night training session at a gym in suburban Chicago. She stepped away from the bench press, dragged her left foot, and collapsed to the floor. She couldn't get up. When the EMT workers arrived, Barnes, then 56, rattled off phone numbers -- her daughter's, her sisters', her doctor's -- without a problem. "I was controlling everything," Barnes recalls. "I kept repeating the information so they wouldn't blow it."
Barnes was still playing boss when she arrived at nearby Edward Hospital. But her condition deteriorated quickly. When the doctors asked her to follow basic commands -- stick out your tongue, lift your finger to your nose, shrug your shoulders -- she couldn't do any of it. She wondered, Did I have a stroke? In fact, yes: She had suffered a hemorrhagic stroke, a very large bleed in the right side of her brain. She immediately went on leave, handing the reins to an interim chief; three months later, still struggling to do even the most basic tasks, Barnes resigned from Sara Lee.
Barnes isn't the first powerful executive to drop out of corporate life for personal reasons. In fact, she herself had stepped off the fast track once before: In 1997 she quit her gig as CEO of Pepsi-Cola North America to spend time with her family -- igniting the "Can women have it all?" debate that still rages -- only to return to the business world in 2004 as president of Sara Lee. But Barnes's story offers an emotional look at what happens when a highflier's career is curtailed, involuntarily, at the top of her game. Her stroke, more than any challenge in her business life, showed Barnes the power of accepting reality, recalibrating priorities, and redefining success. "I hate not being able to do it all," admits this fiercely independent woman who learned to rely on others. In the process, she grew closer to her family. She also channeled the intensity that she once had for business into a recovery that she calls "miraculous."
Spending time with Barnes today in her home in Naperville, Ill., 30 miles west of Chicago, I found it hard to believe that just over two years ago she was not able to sit up or even hold her head straight. Back when she was running Pepsi (pep) and Sara Lee (now called Hillshire Brands (hsh)), Barnes was always trim and youthful-looking, and she still is. The difference is that her left arm and left leg are now stiff from paralysis. She wears a leg brace. Her speech, meanwhile, is clear. And her mind is sharp.
While Barnes was starting her recovery, her colleagues at Sara Lee were wrestling with what to tell investors. For publicly held companies with sick CEOs, the rules are not very clear, as observers of Apple (aapl) found out when Steve Jobs became ill. Three days after Barnes had her stroke, Sara Lee announced only that she would take a medical leave of absence. The company disclosed no details. Barnes herself resolved the mystery. She directed her communications team to issue a press release on June 14 that read, "I suffered a stroke a few weeks ago, and I am now in the process of recuperating."
As it turns out, Barnes's stroke was not a complete surprise to everyone. Three years earlier, after feeling occasional numbness on her left side, she had checked into the Mayo Clinic. The doctors there told her that she had neurological issues that might eventually be problematic. They also urged her to continue living her life as she had been. Barnes told only her family, her executive assistant, and Sara Lee's board about the medical report. "I don't like people worrying about me, cutting me slack," she says.
After her stroke, Barnes spent three weeks in the hospital and then five weeks at the Rehabilitation Institute of Chicago, the top-ranked U.S. rehab facility, according to the National Institutes of Health. At the start of her stay at RIC, "I couldn't hold my head up," she recalls. "I couldn't swallow. I couldn't eat. I had a stomach tube." One exercise required her to place foam balls in a crate beside her wheelchair. "It required every ounce of strength that she had," says her daughter, Erin, 23.
For the first time in her life, Barnes had to depend on others, including Erin, who had graduated from Notre Dame the same week her mother had the stroke. While her mom was fighting to survive, Erin was starting a sales job at Campbell Soup (cpb); within a month she decided to quit, move home for a year, and help her mother recover. "My mom left Pepsi when I was 9 to be home with us," Erin says. "Now my mom needed me. It was an easy decision to make." (Barnes's two sons, Jeff and Brian, live in California.)
During her months of intensive rehab, Barnes learned to walk, speak, shower, brush her teeth, button her shirt, put a contact lens in her eye ... get back to life. She threw herself into each humble mission with the same zeal she once used to address thorny financial and marketing problems. Rehab patients are instructed not to rule anything out -- and Barnes didn't. But by early August she realized she wasn't recovering quickly enough to return to work. On Aug. 9, three months after her stroke, Sara Lee announced her resignation. Barnes said in a letter to employees, "I've always looked at my life as a book, with each experience a new chapter. This chapter is certainly not one of my favorites, but it is only one of many."
Today Barnes is in some ways healthier than she's ever been. "I may not be able to move every part of my body, but I feel great," she says. She is sleeping 10 to 12 hours a night instead of six. "Sleep is such a healer." She still goes to rehab once a week to work on her balance and muscle strength. She can handle the stairs in her home, and every November she and "Team Brenda" -- a group of friends, relatives, and Sara Lee colleagues -- climb Willis Tower, Chicago's tallest skyscraper, to raise money for RIC, the rehab center. Last fall Barnes climbed three flights of the 108-story tower. She's aiming to do five at this year's event on Nov. 4.
"The hardest thing about having a stroke is not being able to be independent," Barnes explains while we chat in the tidy library of the home she built four years ago as she was divorcing her husband, Randy. Her illness, she says, brought blessings. It has strengthened her bond with her five sisters. She talks with each sister at least once a week. Her younger sister Laurna now lives with Barnes.
Barnes admits that she misses work. "I miss having a team and having that challenge," she says. One of her challenges now is to conquer her "left neglect," a condition that makes her see the right side of things -- a clock, a plate of food, the page of a book -- but not the left. "I walk and bump into things on the left side," she says.
Neuroplasticity -- the brain's ability to develop new pathways -- offers hope. "Brenda's recovery is far from done," says Dr. Joanne Smith, CEO of RIC. Barnes plans to drive a car again. While she's been tempted by calls about corporate board positions, she is resisting because travel is difficult. Also, she fears the corporate entrapment that she remembers so well. This is a woman who used to get up at 4 a.m. to squeeze in workouts and who spent half of her time on the road. "When I get passionate, I don't know my boundaries. It's my curse," she says, adding, "I can't let myself go back to working 15-hour days."
Barnes's advice to anyone else thrown off a career track: "You need a plan for yourself, just like you need a plan for a business." She adds: "I owe it to myself to focus on me." Fitting words, given that Barnes herself is a work in progress.
This story is from the October 8, 2012 issue of Fortune.