A company in need of new direciton. (Marcio Jose Sanchez/AP Photo)

The past few years have been difficult—to say the least—for McDonald's. Just ask the company's soon-to-be-former chief executive.

The fast food behemoth announced late Wednesday that CEO Don Thompson will be stepping down after only two and a half years at the helm. Steve Easterbrook, who currently serves as McDonald's senior executive vice president, will replace Thompson as CEO on March 1, when the move takes effect.

"It's tough to say goodbye to the McFamily, but there is a time and season for everything," Thompson said in a statement.

Indeed there is.

The change in leadership at McDonald's comes on the heels of one of the toughest stretches in recent memory for the world's largest fast food chain. Sales, both globally and domestically, have disappointed as of late. McDonald's reported a 21 percent drop in global profit for its most recent quarter, as well as a nearly 2 percent dip in U.S. same store sales (those for restaurants open for at least a year).

McDonald's business in Asia, where it has long looked for expansion, has suffered amid food scares. But it's the company's inability to reinvigorate its domestic business, which still accounts for the majority of its sales, that has been especially pronounced. McDonald's, after all, hasn't reported an increase in same store sales in the United States since October 2013, well over a year ago.

Righting the ship won't be easy. McDonald's struggles haven't persisted, after all, for lack of effort to reverse them. The company has tried everything from offering free coffee to extending value menus and adding a made-to-order hamburger experience. A recent marketing campaign aims to quell customer worries by answering questions submitted by patrons. In one, the burger chain explains why its french fries have 19 ingredients.

McDonald's, however, is optimistic about Eastbrook's ability to change the company's course. "The Board is confident that he [Eastbrook] can effectively lead the Company to improved financial and operational performance," Andrew McKenna, chairman of the board of directors, said in the statement.

The optimism seems to have already trickled down to the company's shareholders. The company's stock jumped 3 percent in after-hours trading following the news, more than it has since Thompson was appointed CEO in 2012.