By Paritosh Bansal and Joe Rauch

NEW YORK/CHARLOTTE, North Carolina (Reuters) - Bank of America Corp <BAC.N> 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 <BK.N> 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.