U.S.-based personal and commercial banking services provider Virginia Community Bank has agreed to be acquired by peer Blue Ridge Bankshares Inc. for $42.5 million.

Under the pact, Virginia Community shareholders will either get $58 in cash or 3.05 shares of Blue Ridge common stock for each share of Virginia Community common stock they hold.

The acquisition gives Blue Ridge seven more branches in Central Virginia. As part of the move, the company will shift its corporate headquarters to Charlottesville.

The deal, which has received the green light from the boards of directors of both banks and final approval by regulators and shareholders, is expected to close by the end of the year.