Men’s Wearhouse Inc. agreed to buy smaller rival Jos. A. Bank Clothiers Inc. for about $1.8 billion in cash, ending a five-month takeover battle between the two menswear retailers.

Both companies’ boards have approved the transaction, the retailers said today in a statement. Jos. A. Bank also will terminate a separate deal to buy the Eddie Bauer brand and cancel a plan to buy as much as $300 million of its own stock.

Today’s agreement settles a feud Jos. A. Bank began in October with an offer for its larger rival. Men’s Wearhouse turned down that proposal and countered with multiple bids for Jos. A. Bank, all of which were rejected as too low. Jos. A. Bank said it would begin talks with Men’s Wearhouse last month following a sweetened $1.78 billion offer.

“It’s a strong acquisition that is mutually beneficial to both companies and shareholders of both companies,” Mark Montagna, a Nashville, Tennessee-based analyst for Avondale Partners, said in a phone interview.

Jos. A Bank chairman Robert Wildrick is planning to leave the company after the sale, two people with knowledge of the matter said. The combined company will be run by Men’s Wearhouse Chief Executive Officer Douglas Ewert, the people said, asking not to be identified as the information is still private.

Jos. A. Bank, based in Hampstead, Maryland, rose 3.8 percent to $64.20 at 2:11 p.m. in New York. Houston-based Men’s Wearhouse climbed 4.8 percent to $57.20.

Combined Company

The combined company will have more than 1,700 U.S. stores and sales of about $3.5 billion. Jos. A. Bank can benefit from Men’s Wearhouse’s tuxedo-rental business, while Men’s Wearhouse can learn from Jos. A. Bank’s ability to inexpensively source products, Montagna said.

The deal will result in as much as $150 million of annual savings realized over three years, the companies said today. Jos. A. Bank’s approximately 600 stores will retain their name.

Jos. A. Bank had been told by five of its largest shareholders to start talking to its rival about a sale, people with knowledge of the matter said in January.

The retailer imperiled the possibility of a tie-up with Men’s Wearhouse in February, when it agreed to buy the Eddie Bauer brand in an $825 million deal that would have created a company too big for its suitor to acquire.

Eminence Capital LLC, a New York-based hedge fund that owns shares in both companies, supported Men’s Wearhouse’s most recent bid. Eminence Chief Executive Officer Ricky Sandler said in February that the offer represented “a superior alternative” for shareholders over the Eddie Bauer deal.

‘Economically Irrational’

Men’s Wearhouse had sued Jos. A. Bank, saying it was “economically irrational” for its rival to use the Eddie Bauer deal to fend off a merger. Men’s Wearhouse also accused Jos. A. Bank directors of breaching their fiduciary duties by enacting a shareholder rights plan, or poison pill, to make it more difficult for an acquirer to buy the company.

Golden Gate Capital Corp., the San Francisco-based private- equity firm that was selling Eddie Bauer, said it respects Jos. A. Bank’s decision to terminate the deal and is pleased to continue owning the brand.

Men’s Wearhouse’s $65-a-share purchase price is 56 percent higher than Jos. A. Bank’s closing price on Oct. 8, the day before its offer for Men’s Wearhouse was publicly disclosed.

‘Best Interest’

“They finally got to where they felt like it was in everyone’s best interest to do the deal,” said Craig Hodges, chief investment officer of Dallas-based Hodges Capital Management Inc., which recently sold its Jos. A. Bank stake. “They got quite a bit more than what they were originally offered, so it sounds like they did a good job of negotiating.”

Men’s Wearhouse and Jos. A. Bank hold a combined 29 percent of the men’s clothing-store market, according to a September report by Vanessa Giraldo, an industry analyst at IBISWorld Inc.

Suits and formal wear accounted for an estimated 32 percent of menswear revenue in 2013, the largest share of industry sales, Giraldo said. Revenue in the men’s clothing industry is forecast to grow 3.1 percent a year to $10.9 billion in 2018.

“Suits are going to change a little bit in color and style, but they’re not going to fade away,” Giraldo said in a phone interview.

Suit spending that had shifted toward department stores and online retailers since the recession is likely to move back toward specialty stores because they have better service, she said.

Industry Evolution

The men’s suiting industry has evolved since the early 1990s, when work environments became more relaxed and casual Fridays were introduced, Tom Julian, men’s fashion director at the Doneger Group, a New York-based researcher of industry trends, said in a phone interview.

Now, with the ubiquity of the Internet and Millennials who came of age shopping for themselves, men are more aware of fashion and interested in wearing suit separates, buying brand names and imitating styles like the shrunken suit look inspired by the television show “Mad Men,” Julian said.

In response, retailers must adapt to provide men with more than a uniform, he said.

“There’s a guy who can go in and find a pseudo designer look at a great price at a corner store or at a mall,” he said. “It’s very self-expressed, it’s not driven by rules and fashion dictation but by likes and personal choices.”