Sandy Spring Bank has inked a $25.4 million agreement to acquire CommerceFirst Bank of Annapolis, gaining the Olney institution a greater presence in central Maryland and a larger portfolio of small-business loans.

The acquisition would give Sandy Spring an additional $205 million in assets, $181 million in loans, $180 million in deposits and five branches in Anne Arundel, Howard and Prince George’s counties.

The purchase price, at $13.60 a share, consists of roughly 732,000 shares of Sandy Spring common stock and $12.4 million in cash. CommerceFirst shareholders can opt for stock, cash or both. Both boards have given a thumbs up on the deal, which is expected to close in the second quarter of 2012, subject to regulatory approval.

Once the deal wraps up, Sandy Spring will boast roughly $3.8 billion in assets and $2.4 billion in deposits. The bank anticipates the transaction will boost its earnings per share, minus one-time transaction expenses.

“It’s a really win-win,” said Sandy Spring president and chief executive Daniel J. Schrider. “CommerceFirst has a quality group of bankers and has done a great job of serving the local business community.”

Richard J. Morgan, CommerceFirst’s president and chief executive, plans to join Sandy Spring as market president of the greater Annapolis region. Morgan also is to be charged with building the bank’s presence in Prince George’s County and overseeing its Small Business Administration loan portfolio.

Under Morgan’s watch, CommerceFirst became one of the top five Small Business Adminstration lenders in the Baltimore region, according to the federal agency. The commercial bank specializes in loans to small to medium-size businesses.

“Rick is a very seasoned banker in the Anne Arundel County market, serves on the Federal Reserve Board of Richmond ... and is very entrenched in that market,” Schrider said.

As for the other 37 employees at CommerceFirst, he said the bank will look for redundancies over the next three or four months and cut where needed.

CommerceFirst has grown at a steady clip since being founded in 2000, nearly doubling its assets in the past five years. During that time, the bank posted two quarters of losses in the midst of the downturn. It recorded profits of $1.4 million through the first nine months of this year, compared to $1.3 million a year earlier.

But prospects for further growth seemed slim, Morgan said.

“Shareholders and the board were frustrated because we continued to do well, but there was very little traction on our stock,” he said. “We needed capital to expand, but when you’re trading at 50 percent of book value, raising capital” by issuing more stock would dilute shareholder value.

The board, he said, weighed the options and decided a sale would be in the best interest of the bank and its customers. Morgan said Sandy Spring, the largest publicly traded bank based in Maryland with 44 branches, had the capacity to handle larger loans and offered extensive retail banking services.

“We’ve competed with [Sandy Spring] on the periphery of their market, so we knew them pretty well. And the philosophies are very similar, so it’s good fit,” Morgan said.

The acquisition allows Sandy Spring to roll up a healthy portfolio of loans as a time when consumers are reluctant to take on new debt, said banking analyst David Peppard of Janney Capital Markets.

“Sandy Spring on its own experienced slight loan growth in the third quarter, which is the first time they have had any since the end of 2008,” he said.

Sandy Spring has been on the mend since suffering losses tied to troubled commercial and residential real estate loans in 2009. The bank’s nonperforming loan ratio improved from 6.42 percent in September 2009 to 4.2 percent of total loans this September. It most recently reported earnings of $11.3 million in the third quarter, up from$8.5 million a year earlier.

When times are good, Sandy Spring has been known to gobble up the competition. It picked up Vienna-based Potomac Bank of Virginia for $66 million in October 2006, followed two months later with a $44.2 million deal for County National Bank in Glen Burnie.

Schrider said more acquisitions may be in store, but “from a priority standpoint, it’s organic growth then M&A — both bank and non-bank.” He is most interested in expanding the company’s footprint in Northern Virginia and Southern Maryland because of the demographics and population growth in those areas.