Shares in Pennsylvania bank

Keystone Financial

( KSTN) surged Wednesday after it announced that it would be acquired by

M&T Bank

(MTB) - Get Report

in a cash and stock deal valued at $1 billion.

Keystone climbed 4 1/4, or 27%, to 20 in midday trading. Buffalo, N.Y.-based M&T saw its shares decline 14, or 3%, to 401. (Keystone closed up 4 1/4, or 27%, at 20 while M&T closed down 14 1/16, or 3%, at 400 15/16.)

The acquisition marks M&T's first major push outside New York state, where most of its roughly 250 branches are located.

Under the terms of the agreement, Keystone Financial shareholders will get 0.5 M&T shares or $21.50 in cash for each Keystone share. That represents a 37% premium over Keystone's Tuesday closing price of 15 3/4.

M&T also announced a 10-for-1 split of its highflying stock, which will take effect in the fourth quarter when the deal is expected to close.

The combined bank would have $29.8 billion in assets, 450 branches and nearly 1,000 cash machines in New York, Pennsylvania, Maryland and West Virginia.