Sandy Spring Bank has struck a $25.4 million deal to acquire CommerceFirst Bank of Annapolis, a move that will give the Olney-based community bank an additional $205 million in assets and $180 million in deposits.

The transaction, which has been approved by both boards, will expand Sandy Spring’s presence in Anne Arundel, Howard and Prince George’s counties, where CommerceFirst operates five branches. The deal is slated to close in the second quarter of 2012 subject to regulatory approval.

CommerceFirst’s president and chief executive Richard J. Morgan will join Sandy Spring as market president of the greater Annapolis region and help build the bank’s presence in Prince George’s county.

“CommerceFirst has done an excellent job of effectively serving small and mid-sized businesses, a prime market segment for Sandy Spring. In particular, they are a recognized leader in local SBA lending, and we look forward to adding these strengths to our own,” said Daniel J. Schrider, president and chief executive of Sandy Spring Bancorp, in a statement announcing the deal.

“The products and services we can offer CommerceFirst clients and the additional locations we will be able to offer our existing clients makes this a winning combination for all concerned.”

Sandy Spring, with $3.6 billion in assets and $2.6 billion in deposits, has been on the mend since suffering losses tied to troubled commercial and residential real estate loans in 2009. The bank most recently reported earnings of $11.3 million in the third quarter, up fro m$8.5 million a year earlier.

As a show of its improving health, Sandy Spring redeemed the remaining $41.5 million of the $83 million in preferred stock issued to Treasury as part of the Troubled Asset Relief Program at the end of 2010.