Signature Bank, a New York financial institution with a big real estate lending business that had recently made a play to win cryptocurrency deposits, closed its doors abruptly on Sunday, after regulators said that keeping the bank open could threaten the stability of the entire financial system.

To some extent, Signature is a victim of the panic around Silicon Valley Bank, which regulators seized on Friday. Its closing underscores the challenges that face small and midsize banks, which often focus on niche lines of business and have a narrower base of customers than Goliaths like JPMorgan Chase or Bank of America. That leaves them especially vulnerable to old-fashioned bank runs.

Silicon Valley Bank, a lender to start-ups, imploded on Friday after some ill-timed financial decisions left it struggling to meet customer withdrawal requests — and just as slowing venture capital funding prompted fledging companies to tap their accounts more. Similarly, Signature became one of the few banks to welcome cryptocurrency deposits, just before the overheated industry blew up last year.

As word about Silicon Valley Bank’s troubles began to spread last week, business customers of Signature began calling the bank, asking if their deposits were safe. Many were worried that their deposits could be at risk because, like business customers of Silicon Valley, most had more than $250,000 in their accounts. The Federal Deposit Insurance Corporation, the entity that seized Silicon Valley, insures deposits only up to $250,000.

In announcing the closure of Signature on Sunday, regulators said that customers of both banks would be made whole regardless of how much they held in their accounts.

“Many depositors at these banks are small businesses, including those driving the innovation economy, and their success is key to New York’s robust economy,” Gov. Kathy Hochul of New York said in a statement.

But on Friday, with customers panicking about their money, Signature saw a torrent of deposits leaving its coffers, according to a person with knowledge of the matter. Its stock, along with the stocks of some of its peers, also continued to tank.

Still, the bank’s leaders expected to be able to weather the storm because the outflows had slowed by Sunday morning, the person said. When regulators told bank executives that they were effectively seizing the bank, which had 40 branches across the country, some of them were shocked. In shuttering the bank, New York bank regulators, acting in concert with the F.D.I.C., also removed its executive team.

The demise of Signature, with assets of under $100 billion, is a blow to many of the professional services firms that have come to rely on it. The bank long specialized in providing banking services to law firms, providing escrow accounts for holding client money and other services.

Scott Shay, Joseph DePaolo and John Tamberlane founded Signature in 1999 with backing from Israel’s biggest lender, Bank Hapoalim. On a personal bio page, Mr. Shay described himself as a “thought leader, and author of several widely read books on profound issues facing the Jewish community.” The bank went public in 2004.

One of Signature’s specialties was financing the purchase of taxi medallions, which authorize holders to operate cabs. It was known in New York for providing banking services to law firms and real estate companies, and for catering to wealthy families in the area.

Its clients had included some individuals associated with the Trump Organization, former President Donald J. Trump’s company. The bank lent money to Jared Kushner, Mr. Trump’s son-in-law, and to Mr. Kushner’s father, Charles. It also helped finance Mr. Trump’s Florida golf course.

Over the past decade, Signature had begun to expand its business nationally, and to the West Coast in particular.

But Signature ran afoul of some of the same issues that led to the demise of Silicon Valley Bank, in that most of its customers had holdings above $250,000.

Regulatory filings show that more than $79 billion, or close to nine-tenths, of Signature Bank’s roughly $88 billion in deposits were uninsured at the end of last year. As of last week, Signature said more than 80 percent of it deposits were from law firms, accounting firms, health care companies, manufacturers and real estate management companies.

The bank also said its digital asset-related client deposits stood at $16.52 billion. Signature was one of the few financial institutions that had opened its doors to taking deposits of crypto assets, a business it entered into in 2018.

That ended up being a fateful decision because the bottom fell out of crypto assets after the collapse of FTX and an ensuing criminal investigation. Another cryptocurrency-focused bank, Silvergate Bank, was forced to voluntarily close last week.

“This story has more to do with crypto, huge error in judgment by veteran bankers,” said Christopher Whalen of Whalen Global Advisors, which specializes in analyzing and consulting on financial institutions. “Result was the same in a deposit run.”

Christine Zhang contributed reporting.