Jack Dorsey, Twitter’s chief executive, added: “Since joining Twitter in 2010, Adam has built an amazing team and a global business from the ground up.”

The changes are more than just the run-of-the-mill executive churn at Twitter, which has seen plenty of departures in the past. Together, they amount to the most significant shake-up under Mr. Dorsey, who was appointed chief executive in October 2015 after an interim stint. He has been struggling to turn Twitter into a moneymaking enterprise with a growing audience, but his efforts have largely stalled and the company recently flirted with selling itself.

Mr. Bain, 43, had his six-year anniversary at Twitter in August. Over his time at the company, he helped build Twitter’s ad efforts from the ground up, and was once considered a top candidate to be chief executive before Mr. Dorsey got the job.

Inside Twitter, Mr. Bain was seen as a corporate cheerleader who was known for his positivity. Last year, employees circulated a hashtag, #AdamBainIsSoNice, after an article about him appeared online in Recode.

In recent quarters, the growth of Twitter’s ad business has slowed and Mr. Bain has had to grapple with a more challenging digital advertising environment. Last month, Twitter said it would slash 350 jobs, or about 9 percent of its work force, as part of an attempt to move the company more quickly toward profitability in 2017. Many of those cuts are focused on restructuring Twitter’s sales and marketing efforts, which were under Mr. Bain.