Analysts and investors were surprised when on Monday morning Marriott International announced its $12.2 billion purchase of Starwood Hotels and Resorts Worldwide, creating the world’s largest hotel company with 1.1 million rooms around the world in more than 5,500 owned or franchised hotels.

While Starwood, whose brands include Sheraton, W, and Westin, put itself on the market in late April, so the announcement of its sale was not a surprise, what was surprising was that Marriott was the buyer. Marriott was not seen as a contender among the rumored suitors such as the Hyatt Hotels Corporation, InterContinental Hotels and a few Chinese companies. Especially considering that on Marriott’s April 30 earnings call a question about a combining the two companies was waved off by the company’s chief executive officer, Arne Sorenson, who said it was not consistent with its previous acquisition strategy, according to the New York Times.

However, in the months leading up to the purchase Marriott saw a relative shift in the values of the company. Marriott and Starwood stocks declined at least 9 percent in that interim, a stronger dollar and competition from Airbnb, the room-sharing start-up, all contributed to making the consolidation more attractive, which effectively changed the dynamics of the deal.

While Hyatt bid competitively to the end and Marriott’s offer was similar to Hyatt’s, ultimately it was decided by Starwood’s board that the former’s stock had greater potential. Once it became clear that Marriott would be the victor, advisors from the two companies met and a deal was reached in New York over the weekend, according to individuals briefed on the negotiations.

The announcement by Marriott on Monday that Starwood would be acquired for $340 million in cash and $11.9 billion in stock meant that the cash portion, a mere 2.8 percent, was the seventh-lowest percentage on record for a deal of its kind greater than $10 billion, according to data from Dealogic. It effectively creates the world’s largest hotel company, with an excess of 5,500 owned or franchised hotels.

The acquisition gives Marriott a larger non-U.S. presence; foreign markets comprise approximately 75% of Starwood’s revenues. It is the largest acquisition of its kind since Blackstone acquired Hilton for $26 billion in 2007. Expected to close in mid-2016, a $400 million breakup fee would be assessed if the transaction is not completed. Executives noted that integration expenditures and total transaction may exceed $100 million, according to Wikipedia.