Business inventories dropped 0.4 percent in May, the sharpest decline in more than two years, the Commerce Department said yesterday.

The fall in inventories indicated that companies may finally have gotten rid of their excess stocks and can increase production to keep up with demand, economists said. However, the decline in May also means that businesses during at least part of the second quarter did not produce as much to replenish their stocks as earlier estimated.

"It looks like business firms have brought inventories under control," said Robert Ortner, the Commerce Department's chief economist. "They have been trying to cut back inventories. It looks like they're accomplishing this real quickly."

The inventories numbers don't "imply much growth in production for the second quarter," Ortner continued. "But with inventories well under control, it augers well for the future."

The drop in inventories was the steepest since it fell 0.6 percent in May 1983, Commerce said.

"It seems to me a sharp fall in business inventories reflects businesses' realization that demand is weak and they must trim their surplus stocks," said Jerry Jasinowski, chief economist for the National Association of Manufacturers.

"Businessmen were simply caught with an overhang of unsold inventories as the economy slowed down," he said. "Further, the inventory figures suggest the second quarter gross national product figure should be considerably lower than" the Commerce Department's "flash" estimate of 3.1 percent growth in the second quarter.

Jasinowski said actual growth was probably around 2 percent in the second quarter.

When inventories are high and demand slows, businesses sell off old stock before purchasing more goods. As a result, production at factories slows until businesses are able to replenish their stocks or demand for goods picks up.

Many recessions have occurred when inventories were not properly managed at a time when demand slowed, forcing sharp cutbacks in factory production, economists said.

In a separate report, the Federal Reserve Board said yesterday consumer credit in the United States rose $9.04 billion in May, or at a 22.4 percent annual rate. That followed a rise of $8.27 billion or a 20.8 percent annual rate of increase in April.

Automobile credit outstanding expanded $3.69 billion in May following a $3.49 billion rise in April, and revolving credit, including retail and bank-card borrowing, increased $2.43 billion, compared with a $2.13 billion rise in April.