Bank of America Corp on Wednesday tapped insider Brian Moynihan as its next chief executive, ending months of speculation about who would succeed Kenneth Lewis to lead the largest U.S. bank.

Moynihan, who heads the lender's retail bank, will take over as CEO and join the board after Lewis' retirement on December 31. He will move to Charlotte from Boston, easing fears raised during the search that the bank's headquarters might move.

Moynihan said in an interview with Reuters late Wednesday his primary mandate is to carry out the business plan arranged by his predecessor, and the Charlotte, North Carolina-based banking giant must block out the distractions created in the wake of the financial crisis.

We need to put the last 18 months behind us, Moynihan said. Now is the time to execute.

Analysts said the new CEO is well positioned to turn around Bank of America, whose massive acquisitions in recent years became a millstone.

Brian has been a fixer. He's good at getting everyone moving in the right direction, said Nancy Bush, a bank analyst at NAB Research, in Annandale, New Jersey.

Many of Wall Street's elite, including Bank of New York Mellon Corp Chief Executive Robert Kelly, had been widely considered to be prospects for the post after Lewis announced plans in late September to retire.

Speculation about Moynihan's ties to the soon-to-be open CEO post ebbed and flowed with the two-month search.

Initially considered a strong contender by analysts and other bank outsiders, he was considered by some outside observers as a long-shot choice after his U.S. Congressional committee testimony on November 17 about Bank of America's Merrill Lynch purchase was widely criticized by analysts and even the committee's chairman.

U.S. House Rules and Oversight Committee chairman Edolphus Towns, D-NY, said after the hearing that Moynihan didn't show the kind of leadership a company would seem to need.

Investors appear relieved to have the matter of Lewis' successor settled.

I'm sure there will be a lot of people that would have preferred to see them go outside the company, to see them have a clean break from everything that happened, said Walter Todd, portfolio manager for Greenwood Capital Management.

At the end of the day, I think it is good they have got somebody in place.

Moynihan takes over a company that is the largest retail bank in the United States -- with 6,000 branches, 18,000 ATMs and nearly $1 trillion in total deposits -- but is undergoing sweeping changes in its other businesses.

As the new CEO, he must finish the integration of mortgage lender Countrywide Financial and investment bank and wealth manager Merrill Lynch into the company.

He must also steer the bank -- which has reported two quarterly losses within the last year, after posting nothing but profits for the last two decades -- back to profitability.

Moynihan offered the advantage of a smooth transition, Bank of America Chairman Walter Massey, who led the search for the new CEO, said.

The board decided after listening to shareholders, regulators and others that Brian's experience was commensurate with or better than any of those candidates, he said in a statement.

Moynihan said he believes the bank's so-called financial supermarket model -- offering a cornucopia of financial services to consumers and businesses -- will work, as some are calling for the break-up of the biggest U.S. banks.

The way we're arranged, we can do a better job for our customer, he said. To me, its logical.

FINDING A SUCCESSOR

Bank of America publicly identified the heads of each of its five major businesses, and its chief risk officer, as potential successors, with no external candidates ever formally named.

Yet according to some media reports, the bank struggled to field enough interested outside candidates -- Kelly said on Monday he would not take the job -- while some investors chafed at the possibility of an internal candidate replacing Lewis.

The bank missed one self-imposed deadline of naming a new chief by the U.S. Thanksgiving holiday on November 26.

During the search, the bank's board relaxed a requirement that the CEO be based in Charlotte, and considered retaining Lewis beyond his December 31 retirement date if a successor could not be found.

Moynihan will move to Charlotte to assume the top job, which has brought some relief to a Southern U.S. city anxious about the possibility of losing a key point of prestige.

This sends the signal that a short-term candidate was not an option, and the board clearly wants someone to lead the bank in a post-TARP world, said Bob Morgan, president of the Charlotte Chamber of Commerce, who added he planned to meet with Moynihan as soon as possible.

FALLEN STAR

Lewis, whose acquisitions transformed Bank of America into one of the dominant U.S. banks, was heralded in 2008 as one of the saviors of the financial system as the bank agreed to purchase Merrill Lynch after a whirlwind negotiation.

But he became a CEO under siege at the end of his tenure, as critics berated the bank's deal to buy Merrill Lynch in September 2008.

Bank of America and some of its executive team and board from that time, including Lewis, are the subject of probes by regulators and state attorneys general concerning billions in bonus payments made to Merrill Lynch employees before the deal closed and billions in fourth-quarter losses run up by the investment bank.

Neither was disclosed to shareholders before the deal was consummated, critics argue, while the bank states nothing improper was done in the course of the deal.

Lewis did meet one of his primary goals, however, repaying $45 billion in aid Bank of America received from the government, as he had said he aimed to do before he left.

Earlier this month, Bank of America sold $19.3 billion of shares and repaid the United States.

(Reporting by Paritosh Bansal, Dan Wilchins, Joe Rauch, Steve Eder and Clare Baldwin; Editing by Gary Hill and Muralikumar Anantharaman)