Jack is back.

Twitter announced on Thursday that Dick Costolo is stepping down as CEO of the social network after months of criticism about his leadership and the company's product execution. The change is effective July 1.

Jack Dorsey, the cofounder of Twitter and its first CEO in its earliest days, is returning as interim CEO of the company while the company looks for a full-time replacement. Dorsey is also CEO of Square, the mobile payments company he co-founded.

"The future belongs to Twitter thanks in large part to Dick Costolo's dedication and vision," Dorsey said in a statement. "Dick has put a world-class team in place and created a great foundation from which Twitter can continue to change the world and grow."

Costolo joined Twitter as chief operating officer in 2009, at a time when the startup was still struggling to stay online without its infamous "fail whale" service interruptions. He presided over the company as it introduced advertising products, grew its user base into the hundreds of millions and ultimately went public in November 2013 with a market cap of $25 billion. Twitter's stock rose to nearly $70 by February 2014 and has fallen to less than half of that.

Since its IPO, however, Costolo and Twitter came under fire from investors for sluggish user growth and a series of executive shuffles, which suggested it was struggling to find a cohesive product strategy to rival more mainstream successes like Facebook.

In recent months, Twitter appeared to find more of a groove by accelerating its product rollouts, including adding advanced features to stop harassment, reshare other users' tweets with ease, and send direct messages to other users. Still, Costolo never quite succeeded in convincing Wall Street that he was the chief executive for the job.

Costolo had repeatedly claimed that his vision was aligned well with the members of the board who would decide his fate. Multiple members of the board, including Dorsey, its chairman, publicly backed Costolo as well — but clearly something changed.

Dorsey founded Twitter in 2006 with Biz Stone and Ev Williams while working at Williams' flailing podcasting startup, Odeo. In later years, after leaving his full-time role at the company, Dorsey would all but take credit for the idea for Twitter. However, according to Hatching Twitter, a tell-all book on the company's founding, Dorsey played a more minor part in its creation and proved to be unready for the task of being chief executive.

Dorsey was pushed out of the CEO role in 2008 and replaced by Williams. The next year, he cofounded Square and presented himself to be an executive in the spirit of Steve Jobs, with a strong design aesthetic and his foot in two prominent technology companies.

For a time, Square was among the most buzzed about startups in Silicon Valley, but last year rumors emerged that it was burning through cash and weighing an acquisition. Square has since worked to provide a broader ecosystem of products for merchants and small businesses in an effort to stay competitive in the growing mobile payment marketplace.

With the latest executive shuffle, Dorsey has a chance to leave an even more lasting imprint on the company he helped found and further his claim to be the new Jobs.

Investors, for their part, just appear to be happy to see someone — anyone — replace Costolo. Twitter's stock shot up by as much as 8% in after hours trading following the news.

TWTR data by YCharts