Bank of America customers with basic checking accounts will be hit with a $5 monthly fee in order to use a debit card for purchases, the bank announced Thursday.

Banks and card companies have been aggressively establishing and raising fees in recent weeks as banks plan for new rules taking effect Saturday that limit the amount they can charge retailers for each debit card purchase.

JPMorgan Chase and Wells Fargo are testing $3 fees for debit cards in select areas, and Citibank recently announced it is raising its fees for checking accounts. Janney Montgomery Scott analyst Thomas McCrohan said last week that Visa and MasterCard, the top two debit card companies, may increase drastically increase fees on small purchases to offset the losses.

SunTrust, a regional bank based in Atlanta, began charging a $5 debit card fee on its basic checking accounts this summer. Regions Financial, which is based in Birmingham, Ala., notified customers this summer that it will charge a $4 monthly fee starting next month.

“The economics of offering a debit card have changed with recent regulations, and we’ve decided to introduce a monthly fee for customers who use their debit cards for purchases,” Anne Pace, a spokeswoman for Bank of America, told Bloomberg News.

Pace said the new debit card fee will be rolled out in stages starting with select states in January. She did not say which states would be affected first. Clients with premium accounts will not be affected, and customers who use their debit card solely to receive cash at ATMs will not be charged.

Bank of America has struggled to recover from the Great Recession, as liabilities from failed mortgages and multiple lawsuits have threatened the bank’s bottom line. Earlier this month, the company announced it would eliminate 30,000 jobs nationwide, about 10 percent of the Charlotte, N.C., company’s workforce. The company’s stock has lost almost half its value so far this year.

The Federal Reserve ruled in late June that fees for debit card purchases could not exceed 21 cents per swipe, with a small amount tacked on based on the amount of the purchase. Previously, banks and card companies charged retailers an average of 44 cents, using a formula of 1.14 percent of each transaction.

There is no similar cap for the fees that banks can collect from merchants when customers use their credit cards, however. That means banks may increasingly encourage customers to reach for their credit cards, reversing a trend toward debit card usage in the past several years.

The consumer costs of banking seem to be rising across the board. A study from Bankrate.com, released Monday, revealed that only 45 percent of checking accounts are free with no strings attached, down from 65 percent the year before and 76 percent two years ago. The study also found that using out-of-network ATMs now costs customers $3.81 each time, up from $3.74, and the average overdraft fee has risen to $30.83 from $30.47.

Bank of America shares rose 9 cents, or 1.5 percent, to $6.25 in afternoon trading.

The Associated Press and Bloomberg News contributed to this report. Contact Jeremy C. Owens at 408-920-5876; follow him at Twitter.com/mercbizbreak.