Procter & Gamble shares jumped Friday after the company said beauty helped propel higher-than-expected revenue growth and reported the strongest quarterly sales gains in five years. It also maintained its profit outlook for the full year.

In recent quarters, the company has struggled to grow sales as demand has waned for some of its household brands like Pampers for diapers. But the company said it sold a higher volume of goods in the latest quarter thanks to a healthy economy in the U.S. encouraging shoppers to spend more, coupled with new product innovation on P&G's behalf.

Its stock climbed more than 7 percent in morning trading on the news, making it the top gainer on the S&P 500 Consumer Staples Index. Shares were on pace to show its biggest gain since of October 2008. As of Thursday's market close, shares had fallen about 11 percent so far this year, bringing P&G's market cap to roughly $202 billion.

Here's what P&G reported compared with what Wall Street was expecting, based on a survey of analysts by Refinitiv:

"This keeps us on track to deliver our top-and bottom-line targets for the fiscal year," CEO David Taylor said in a statement.

Net income for the quarter ended Sept. 30 climbed about 12 percent to $3.20 billion, or $1.22 cents per share, from $2.85 billion, or $1.06 cents a share, a year ago. Excluding one-time items, P&G earned $1.12 cents a share, 3 cents ahead of analysts' consensus.

Sales of $16.69 billion were slightly more that $16.65 billion a year ago and ahead of the $16.46 billion expected by analysts. It reported organic sales growth, which strips out the impact of currency and other adjustments, of 4 percent, better than expectations for an increase of 1.6 percent and fueled by growth in its beauty division. The company owns major brands in this category like Pantene shampoo and Old Spice deodorant.

"There isn't a piece of beauty that isn't growing right now," CFO Jon Moeller said on the company's earnings call.

P&G said beauty net sales rose 5 percent during the latest quarter, while sales in its fabric and home-care division — P&G's largest unit by sales — climbed 2 percent. That helped offset net sales declines of 1 percent in the grooming category, a drop of 3 percent in health care, and a 3 percent decline in baby, feminine and family care.

The maker of everyday household goods like Tide laundry detergent, Crest toothpaste and Charmin toilet paper has been defending its market share against heightened competition from private-label brands and upstart companies such as Brandless, Harry's and Dollar Shave Club. Its Gillette razor brand has struggled as new entrants have entered the space and slashed prices.

P&G's profit margins have also been squeezed, hurt by rising commodity costs, shipping expenses and foreign exchange rates. Moeller told analysts that P&G will need to raise prices in the coming quarters to offset these cost pressures. He said prices were overall neutral in the last quarter.

"These are costs retailers understand. They face the same issues," he said.

During an appearance on CNBC's "Squawk Box" on Friday, Moeller said: "We expect the revenue progress we are making and the bottom-line progress to hold up. There is a very strong underlying economy and we are seeing — despite some of that angst that exists — increases in the rate of market growth, which you expect with the unemployment situation and eventually the wage situation increasingly significantly."

P&G said it's anticipating organic sales growth of 2 to 3 percent for fiscal 2019. It expects core earnings per share to rise 3 to 8 percent, up from 2018 core earnings per share of $4.22.