United Bankshares, the parent firm of United Bank, has agreed to acquire Virginia-based Cardinal Financial in an all-stock deal worth about $912m.

Cardinal has total assets worth $4.2bn, and provides banking services through its subsidiary bank, Cardinal Bank, which has a network of 30 branches throughout Virginia, Maryland and Washington DC.

It also operates George Mason Mortgage, a residential mortgage lending subsidiary, and Cardinal Wealth Services, a wealth management services division.

Under the deal, United Bankshares will offer 0.71 shares for each share of Cardinal Financial. The price represents 2.24 times Cardinal’s tangible book value on 30 June 2016.

Following the completion of merger, United’s assets will grow to nearly $20bn and will become 32nd largest banking group in the US.

Cardinal Bank will merge into United Bank, United’s Virginia chartered bank, headquartered in the D.C. Metro region. The bank will have assets of $14.4bn upon completion of the merger.

The acquisition is expected to close mid-2017, and pending regulatory approval and United and Cardinal shareholder approval.

United Bankshares CEO Richard Adams said: “This merger aligns perfectly with our long-standing commitment to growth in the D.C. Metro area. Both companies have strong ties to the local community, and share the goal of building meaningful relationships with the individuals, businesses, and organizations that contribute to its prosperity.”

Cardinal executive chairman Bernard Clineburg said: “United brings to the table the capacity to meet the sophisticated needs of our customers, while at the same time staying true to our commitment to the communities we serve. In addition, the transaction will add tremendous value for our shareholders."

Clineburg is expected to join United’s board of directors at the time of the merger.