Banks are closing branches at the fastest pace in decades, as they leave less profitable regions and fewer customers use tellers for routine transactions.

The number of branches in the U.S. shrank by more than 1,700 in the 12 months ended in June 2017, the biggest decline on record, according to a Wall Street Journal analysis of federal data.

Branch numbers fell again in the second half of 2017, according to related data submitted to bank regulators and reviewed by the Journal. That would add to the thousands of locations closed following the financial crisis, and is the longest stretch of closures since the Great Depression.

Many of the closings were in big cities and surrounding suburbs, where branches were consolidated largely because of falling foot traffic. Others were in rural areas, where some large regional lenders are leaving town altogether.

While banks battered during the financial crisis such as Citigroup Inc. and Bank of America Corp. started cutting branches years ago, regional banks have only accelerated their closures more recently. From mid-2012 to mid-2017, Capital One Financial Corp. cut 32% of its branches, SunTrust Banks Inc. 22% and Regions Financial Corp. 12%. For all three, the sharpest cuts came in the most recent 12-month period.