The hotel industry has changed since the spring, however. The stocks of Marriott and Starwood have declined at least 9 percent since that time, and trends like the stronger dollar and competition from the room-sharing start-up Airbnb have made consolidation more attractive, according to analysts.

That changed the dynamics of a deal. Hyatt was a competitive bidder almost to the end, people briefed on the negotiations said. But the unexpected suitor, Marriott, had an offer that was similar to Hyatt’s, and the Starwood board ultimately concluded that Marriott’s stock had greater potential, said these people, who spoke on the condition of anonymity because the proceedings were private.

As it became clear that Marriott would prevail, the advisers to the two companies met and reached a deal in New York through the weekend, the people said.

On Monday, Marriott announced that it would acquire Starwood for $11.9 billion in stock and $340 million in cash. That means cash was used for a mere 2.8 percent of the deal, which is the seventh-lowest percentage on record for cash-and-stock deals greater than $10 billion, according to data compiled by Dealogic.

The deal creates the world’s largest hotel company, with more than 5,500 owned or franchised hotels with 1.1 million rooms around the world.