Kraft Foods Inc. on Wednesday posted higher quarterly profit, helped by lower restructuring charges, a lower tax rate and higher sales, which offset rising costs for milk, wheat and other ingredients.

The maker of Oreo Cookies, Crystal Light drink mixes and dozens of other products also said it expects margins to continue to fall in the second half of the year under the weight of higher costs and spending on new products to try to boost sales.

But the company also raised its expectation for sales for the year and left its forecast for earnings, excluding restructuring costs and other items, unchanged.

Kraft said second-quarter profit was $707 million, or 44 cents a share, compared with $682 million, or 41 cents a share, a year earlier.

Excluding one-time items, earnings were 50 cents a share.

Analysts on average had forecast 47 cents a share, according to Reuters Estimates.

Kraft, which was spun off from Altria Group Inc. on March 30, has struggled with higher prices for ingredients and falling market share in products like frozen pizza and nuts.

But at the same time, the company has attracted high-profile activist investors Nelson Peltz and Carl Icahn, who both purchased stock in the company, with Warren Buffett's Berkshire Hathaway Inc. reported to have bought a stake too.

The company also is planning to expand its European business, having said in July that it is in exclusive talks to buy the cookies and cereal snacks business of France's Danone for $7.2 billion.

Revenue rose 6.8 percent to $9.21 billion, with 2.2 percentage points of the increase the result of the weaker dollar, which boosts the value of international sales when they are reported in dollars on the company's income statement.

Volume, a measure of products sold that factors out currency and price fluctuations, fell 0.7 percent.

The company had a tax rate of 32.5 percent before one-time items in the second quarter, down from a tax rate of 33.4 percent a year earlier.

For the full year, the company forecast a tax rate of 33.5 percent, excluding items, down from 35.5 percent a year before, due to the resolution of outstanding tax issues as well as a change in the mix of earnings by country.

The company said it now expects sales to be up 4 percent or more, excluding the impact of currency, acquisitions and divestitures. That compares with its prior forecast of a 3 to 4 percent increase.

The forecast for earnings per share excluding items remained at $1.75 to $1.80. Analysts, on average, had forecast $1.80 a share, according to Reuters Estimates.

The company said it still is on track to spend $300 million to $400 million on new products and other growth initiatives, despite higher ingredient costs.

Kraft shares traded at $33.00 on Wednesday in premarket electronic trading. They closed Tuesday at $32.98 on the New York Stock Exchange and through Tuesday, the stock was down 8.3 percent this year, compared with a 1 percent increase for the Standard & Poor's packaged foods index.