It's time to suit up: Men's Wearhouse is buying Jos. A. Bank for $1.8 billion.

Men's Wearhouse will pay $65 per share, a 5% premium to Jos. A. Bank Clothiers's closing price Monday of $61.83.

The agreement ends a months-long back and forth that began in October when Jos. A. Bank offered to buy its larger rival for $2.3 billion. Men's Wearhouse scoffed at that offer, and turned the tables, offering to buy its rival for $1.54 billion.

By early March Men's Wearhouse had an offer of $63.50 per share on the table but said it may raise the bid to $65 per share if some conditions were met.

The combined company will be the fourth-biggest U.S. men's clothing retailer with more than 1,700 U.S. stores and about $3.5 billion in sales.

The transaction is expected to close by the third quarter.

The Motley Fool has no position in any of the stocks mentioned. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.