Hartford Financial Services Group Inc named a former Bank of America Corp executive to replace its chairman and CEO, Ramani Ayer, who had announced plans to retire in June after the 199-year-old insurer struggled with record losses.

Liam McGee, former head of consumer banking at Bank of America, will become chairman and chief executive at Hartford effective October 1, the company said on Tuesday.

Hartford has taken $3.4 billion in federal aid to shore up its finances after massive losses, although its shares have rebounded since Ayer's retirement plans were announced, gaining 84 percent since early June.

Ayer, 62, will resign on October 1 as chairman and chief executive after serving in the top two posts since February 1997, and retire officially on November 1.

The choice of a banking executive to head up the Connecticut-based property and casualty insurer was unusual for the industry, said Drew Woodbury, insurance analyst with Morningstar.

I'm a little bit surprised they went outside the insurance sector, he said, adding that most insurance firms typically look for chief executives with prior industry experience.

Ayer had spent his entire career with Hartford Financial.

McGee, 55, once considered a potential successor to Bank of America's Chief Executive Ken Lewis, is the former head of Bank of America's consumer and small business banking unit, and left the Charlotte, North Carolina-based bank in August after spending nearly two decades with the company.

(Reporting by Joe Rauch; Editing Bernard Orr, Phil Berlowitz)