J.C. Penney Co. Inc. is returning to its roots.

For the past three years, the nation's third-largest retailer has been trying to entice more affluent, fashion-conscious consumers to its 1,500 stores by offering trendier, higher-priced apparel. Designer clothes with labels bearing the names of Halston, Mary McFadden and Lee Wright were displayed prominently at store entrances, replacing the racks of the more moderately priced goods for which Penney was known. These items were moved to smaller and less conspicuous spots in the stores.

For special sales events, the chain turned to Europe, first to "salute Italy," then to honor the "Best of Britain" as Charles and Diana, the prince and princess of Wales, paid a visit to the 84-year-old institution.

But today, after sluggish sales and declining profits, Penney is coming back to America and its traditional price-conscious customer. The chain still is trying to lure the working woman, the trendy teen-ager and fashion-conscious male who typically have shopped at other retailers for their clothes.

But, at the same time, Penney is actively wooing middle America. Prices on key items have been lowered, the moderately priced clothing departments have been greatly expanded and promotions now feature the lower priced goods instead of the newer designer lines. The designer clothes still are available, but they are mixed in with the other merchandise, no longer getting prominent display space. Meanwhile, in its catalogue, the trendier clothes are being replaced with more classic-looking apparel.

What's more, for its next big promotion, the chain will feature the United States. Its eight-week sales campaign, which will be launched next month, will "celebrate American style."

"You don't change customers' perceptions overnight," commented Vice Chairman Robert B. Gill. Gill stressed that the chain was not abandoning its strategy of trying to become a national department store offering the latest fashion. However, he noted, "We still feel we have work to do in refining that strategy . . . . It takes time."

As for its long-term future, Penney is planning to return even more to its past and the roots of its founder, James Cash Penney, as the retailer pins its growth on rural America. While closing many of the older, underperforming stores in the large metropolitan areas, Penney will target its future growth in towns with populations of 50,000 or less.

"We grew up in small-town America," noted David F. Miller, president of JCPenney Stores and catalogue operations. "What we're doing is going back, identifying towns under 50,000 . . . where we can be the number one in town, the 'in' place to shop."

For the moment, Penney is enjoying the status of the "in" stock among many financial analysts who follow the stock of retail companies. Although many of these analysts express concern over the company's long-term future as competition continues to mount, they are actively encouraging investors to buy Penney's stock today.

"Penney is beginning to move out of an underperformance hole," said Edward A. Weller of E. F. Hutton Group Inc. Its "renewed appeal to its traditional value-oriented customer will continue to drive the business forward. . . . We believe the shares are attractive for accumulation."

This recommendation, one of many now being issued on Wall Street, is in sharp contrast to the criticism voiced over the past few years about Penney's $1 billion modernization campaign.

As part of that campaign, Penney dropped some major departments -- including paint and hardware, major appliances, lawn and garden goods, fabrics and automotive centers -- to concentrate on becoming a more fashion-driven organization. In the place of these departments, Penney expanded its home-furnishings and apparel departments and focused much of its attention on more expensive, fashionable goods than it had been pushing in the past.

The purpose of this strategy "was to position ourselves to be more in tune with exactly what the customer is looking for in our stores," Gill explained. "Our customers were telling us that they liked the Penney company for its value, its honesty and its integrity; that they liked to shop at Penney to buy hosiery, sheets, kids' clothes and sportswear." However, at the same time customers also were saying they "really don't find the fashionable goods they like to buy," Gill said.

But ever since the modernization program was launched three years ago, sales have been sluggish -- increasing only 2.1 percent in 1985.

Profits were even more disappointing, dropping from a high of $467 million in 1983 to $397 million last year.

"It was an utter disaster," commented Stacy Ruchlamer of Shearson Lehman American Express Co. "They were outstepping themselves, going too upscale."

"On paper it was a wonderful strategy," said Alan Pennington, president of the retail consulting firm Pennington Associates. "But in execution, they made two colossal mistakes. They took fancy designer names, such as Halston III, which Penney customers really didn't want. They were aiming for an image that was too high. At the same time, they took their eye off what they were really good at -- the basics such as sheets and underwear. They got hung up with fashion and forgot the strength of the business."

But then last fall, Penney began what officials said was merely a fine-tuning of its strategy, lowering prices on only a handful of merchandise and offering more moderately priced goods storewide.

Retail analysts say the fine-tuning was much more dramatic. "Even high-fashion items such as the Halston line currently sell at prices 20 percent below those of a year ago," noted Walter F. Loeb of Morgan Stanley & Co.

Fine-tuning or not, the changes made an immediate and dramatic difference in the bottom line. Store merchandise managers say they saw an immediate 15 percent increase in sales in the moderate-price departments. For the entire chain, sales climbed by nearly 6 percent in the fourth quarter over the previous year -- a sharp contrast to the 1 to 2 percent sales increases posted in the previous three quarters.

Profits, which had been dropping for the four previous quarters -- and by as much as 40 percent in 1985's second quarter -- turned around, climbing nearly 4 percent during the last quarter. That climb, however, did little to overcome the decline recorded earlier in the year. As a result, the company posted an 8.6 percent decline in profits for all of 1985, to $397 million from the $435 million posted a year earlier.

According to Penney officials, the fourth-quarter turnaround is not the result of its fine-tuning but rather proof that its overall strategy is working. "There was never a period when we didn't think it would eventually work," said Miller. It just took longer than expected, he noted, saying, "I think we misjudged the span of the learning curve."

Penney has no intention of changing its goal to become the "national department store for middle-income America," offering fashion as well as value, Miller added. "It's a gradual process. . . . It's going to take a long time to overcome mistakes made in the past. There was a time when J. C. Penney dominated the low price points in women's apparel. We had better than 80 percent of the dress market below $5 25 years ago. We were very successful in doing the wrong thing. We've got to back that out of people's minds."

Penney has not been alone in its modernization strategy -- or in the problems that ensued. The nation's two largest retailers, Sears, Roebuck & Co., and K mart Corp., have both undergone major renovations over the past three years, trying to introduce more upscale, fashionable goods to their stores just like Penney.

"The moderate price-oriented customer who represents the middle class has been largely forgotten," Loeb noted. "That consumer is very much alive, however, and holds 60 percent of the spending power in the United States."

Thus, it was no surprise that the earnings of these three giants began to suffer, Loeb and others note. Although there were other factors that helped contribute to the decline, including sluggish consumer spending in general, Sears' revenue from its merchandising division was virtually flat, while its profits dropped from $656 million in 1984 to $447 million in 1985.

K mart saw a 6.2 percent increase in sales last year; but like Sears, its profits from continuing operations also dropped, from $498.7 million to $471.2 million.

Both chains are now, like Penney, trying to improve their results, partially by focusing more on the middle-income consumer.

But, noted Thomas P. Farley of Salomon Brothers, "Penney has moved quicker than the other two to batten down the hatches and get its house in order."