Prices paid to farmers, factories and other producers rose modestly in July, with climbing energy costs overpowering a drop in food prices, the Labor Department said yesterday in a report that brought cheer to the stock and bond markets.

The producer price index rose 0.2 percent in July, following a 0.1 percent dip in June. But the "core" index, excluding volatile food and energy costs, was unchanged. The numbers were below the expectations of many economists, who had predicted a rise of 0.3 percent for the overall index and 0.1 percent in the core.

Financial markets rallied on the news, which indicated that inflationary pressures remain muted. However, many analysts and investors believe Federal Reserve policymakers still may raise the overnight lending rate by a quarter point when they meet next on Aug. 24. Fed Chairman Alan Greenspan told Congress last month the central bank would act "promptly and forcefully" to contain rising inflation if it became evident.

The price report "was good news, particularly in the core rate," said Greg Jones, chief economist for the online investment site, "But Greenspan and the rest of the Fed have not made the case for tightening on the basis of current or past inflation. They make the case on the threat of future inflation."

The Dow Jones industrial average rose 184.26 points to close at 10,973.65, while the Standard & Poor's 500-stock index jumped 29.52 to 1327.68. Both were the strongest gains since April. The technology-dominated Nasdaq composite index, meanwhile, soared 88.32 points to 2637.81.

Bonds also rallied, with the yield on the benchmark 30-year Treasury falling to 6.10 percent. The bond market already expects the Fed to raise short-term rates later this month. The yield on a September contract tied to the Fed's overnight lending rate already is close to 5.25 percent. That is 0.25 percentage points above the federal funds rate, which the Fed raised to 5 percent from 4.75 percent on June 30. So bond traders are betting the rate will reach 5.25 percent by next month.

"The market has already priced it in," said Henry Willmore, chief U.S. economist for Barclays Capital in New York, a bond-trading firm. He said that explained why the bond market rallied after the report.

Much of the July increase in the index was attributable to a large spike in the energy price component, which rose 3.4 percent, the biggest jump since April. The index of gasoline prices rose 12.7 percent in the month, also the sharpest increase since April.

In contrast, the food price index fell 0.9 percent in July, after rising 0.4 percent in June. The index that measures prices of beef and veal, in particular, fell sharply.

Indexes measuring the prices of other items commonly purchased by consumers, including passenger cars and computers, fell. But producer prices rose for prescription drugs and alcoholic beverages.

Some economists seized on what they see as a troubling increase of 0.4 percent in the index for intermediate goods excluding food and energy--in essence, products still in the production pipeline. The July increase followed a 0.4 percent rise in June. If companies do not find ways to absorb those increased costs, through higher worker productivity or some slip in their profit margins, these higher prices could eventually find their way into the prices consumers pay.

"Ultimately, these higher prices will be passed through," said First Union Capital Markets economist Mark Vitner. "The rise in core intermediate goods prices virtually assures a Fed move in August, and contrary to this morning's rally on Wall Street, seems to make an October tightening more likely."

The July producer price index was the latest in a slew of reports that show a strong economy with little, or relatively mild, inflationary pressures developing. Although recent reports showing stronger-than-expected job growth and some evidence of wages rising faster than worker productivity have raised concern about rising inflation, other reports and the Fed's own review of economic conditions this week show the U.S. economy continues to enjoy a benign mix of strong demand without pricing pressure.

One explanation for this best-of-both-worlds state, economists say, is that companies continue to find ways to squeeze more product out of their workers despite the tightest labor markets since the Vietnam War. While wages have been going up, workers appear to be producing more for every hour worked. This has led to rising profits, which are underpinning the lofty valuations in the stock market.

"Even though we're seeing some pressure on input costs, the productivity growth has been so strong that profit margins are indeed going up," Jones said.

Jones said companies must increase productivity because there is still a lot of slack in worldwide capacity for many goods, thereby restricting the ability of firms to raise prices. And, he said, the Internet is another force contributing to the weakness in prices.

"Even if cost pressures become more intense, I don't think it's clear businesses can pass them along," Jones said. "We might see lower profit margins instead of more inflation."