BEIJING — China’s hidden banking system is coming out of the shadows as the government seeks to rein in the excessive lending that it fears could spin out of control.

The People’s Bank of China, the central bank, let the world know on Monday that it was putting the nation’s banks on notice: the loose money and the speculation it fed had to stop. It said banks had to step up risk controls and improve cash management. And they had to do it, the bank said, by avoiding a “stampede” mentality.

The banks had quietly received that very message a week earlier, which set off, if not a rush for the exits, certainly widespread worry in China and financial centers around the world.

It precipitated a cash squeeze among the banks that sent their short-term interest rates sharply higher last week. The crackdown, which appears aimed at reining in banks engaged in complex deals that involve hiding and repackaging risky loans so that regulators cannot notice them, also led to a sharp sell-off in stocks worldwide during the last week. Investors feared it might further slow the Chinese economy.