At trial, she came off as Mean Martha: rude, demanding, cheap, the kind of person who would threaten to pull her business from a brokerage because she didn't like the music she heard when her call was on hold.

Then she went to prison and turned into St. Martha: advocate for the oppressed, friend to the lonely and forager for wild greens to spice up the jailhouse food. And on Friday, her first day outside the lockup, she waved graciously, chatted amiably and served hot cocoa to the press.

The transformation of Martha Stewart's (search) image dates to five months ago, when she called a news conference to announce she was reporting to prison early, despite a pending legal appeal.

Wearing a white suit against a backdrop of color swatches, Stewart projected a change in attitude that has helped repair her reputation and propel her company forward again.

"Going to jail was a good thing," says Paul Argenti, a professor at the Tuck School of Business (search) at Dartmouth. "She had to do that, and fighting it was a bad idea."

Indeed, stock prices for Martha Stewart Living Omnimedia (search), which had lagged, quickly doubled. And as she worked off time in a West Virginia prison, scrubbing floors and picking dandelion greens, she found herself popular enough to be given starring roles in two upcoming TV shows.

"The thing about Americans is we like throwing you to the ground, and making you cry uncle," image consultant Eric Dezenhall said. "But if you do cry uncle we'll let you up."

Stewart's tasteful, if chilly, image had taken a beating in trial testimony. Jurors laughed when Douglas Faneuil, an assistant to Stewart's stockbroker, told the court she went into a tirade when she was put on hold, complaining about how bad the music was and threatening to leave if it wasn't changed.

The daily news coverage of her entering the courthouse, accompanied by details about her pricey handbags or stylish heels, didn't help.

"People already knew she was a perfectionist," said Melissa Click, a research instructor at the University of Missouri-Columbia who is writing a book about Stewart. "But they didn't necessarily want to hear that she was mean."

When she was sentenced in July, a still-unrepentant Stewart said her "small personal matter" had become "an almost fatal circus event of unprecedented proportions." She also took the opportunity to boldly pitch her products and her magazine.

The same day, her Web site erroneously posted a draft of a letter she wrote to the judge, saying her punishment was "unfortunately" in the judge's hands.

This was not the prim, proper and controlled Martha Stewart who had amassed a billion-dollar domestic empire by being adored as an expert tastemaker in millions of homes around the country.

Then, on Sept. 15, Stewart asked the judge to start her sentence as soon as possible — "to reclaim my life and the quality of life for all those related to me with certainty." She lamented she would miss her dogs and her horses, her cats and her canaries, and wanted to be home in time to plant a spring garden.

And she came closer than ever to contrition, saying she wanted to end the "immense difficulty, immense sacrifice and immense agony" the ordeal had caused those close to her.

Three weeks later, Stewart was fingerprinted and strip-searched at the federal prison in Alderson, W.Va., then assigned a bunk bed in a building with 60 inmates and two showers.

At Christmas, in an open letter published on a Web site, she asked her fans to think of her fellow inmates and seek sentencing reforms.

On Thursday, she paid for a flatbed truck that would give photographers a better view of her departure from West Virginia, the airport manager said. And on Friday, back at her estate in New York, Stewart barely waited for the sun to come up before delighting the encamped reporters and photographers by appearing outside with her dog and horses and taking time to discuss lemons and cappuccino. The topper was when she sent out paper cups of hot cocoa.

At an investment club called ESP in Pelham, N.Y., about 30 miles from where Stewart will spend the next five months, members aren't about to give up their Martha Stewart stock.

"She's got a lot of good years ahead of her," said Amelia Galiani, the club's treasurer. "Sixty-three is not the end of the world. I think she probably will have a good comeback."

Another member, Maggie Klein, said, "Whatever she did, it doesn't rank with Enron. I guess I'm in the camp where I think they just picked on her."