First National Bank of Maryland was established in 1864 and distinguished itself by continuously paying dividends to shareholders, even during the Great Depression. In 1989, Allied Irish Banks, PLC of Dublin, Ireland, purchased First Maryland Bancorp. The transaction marked the first acquisition of a major Maryland bank by a large foreign banking institution. In 1999, after more than a year of planning and test marketing, the company's name changed to Allfirst Financial Inc. But the bank was brought down by millions in losses by rogue trader John M. Rusnak in 2002, leading to its eventual sale to Buffalo-based M&T Bank.