The First, N.A., a subsidiary of The First Bancorp Inc., said it agreed to buy two properties from Camden National Corp. for $7.7 million.

Under the deal, The First will purchase the branch at 63 Union Street in Rockland and the 145 Exchange Street building in Bangor.

The Rockland branch represents one of 15 Maine branches Camden National is currently acquiring from Bank of America. Camden National is divesting this branch to resolve competitive concerns in that market raised by the U.S. Department of Justice’s Antitrust Division. Customers who bank at the existing Rockland branches of The First and Camden National will not be affected.

The First said it will retain the employees of the 63 Union Street branch.

In Bangor, The First intends to open a full-service banking center at the 145 Exchange Street location in the first quarter of 2013. Upon completion of the acquisition, the Camden National branch in Bangor will be relocating from the 145 Exchange Street building to the 80 Exchange Street branch they are purchasing from Bank of America.

The Rockland branch transaction is subject to regulatory approval, and is expected to close in the fourth quarter of this year. The sale of the 145 Exchange Street building in Bangor will close at the same time.