Embattled Twitter CEO Dick Costolo will step down on July 1, the company said Thursday.

Costolo will remain on the social media company's board while Chairman and co-founder Jack Dorsey will take the position on an interim basis. Twitter will look for successors both internally and externally, but Dorsey suggested on a call after the announcement that there would not be any strategy changes. Many investors and analysts have called for a shakeup amid a sluggish run for Twitter's stock. The company has struggled to expand its user base and grow revenue through advertising and other streams. Investors reacted positively to Costolo's departure Thursday, as shares spiked as much as 9 percent in extended trading.

Read MoreTwitter CEO and board are 'totally in sync'

But sources told CNBC that Costolo was not forced out, and that it was actually his decision to step down, something he had been considering for some time. "This transition is not the result of anything more than Dick deciding to move on from his role as CEO," Dorsey said on a call after the announcement. "There is no connection with our near-term results." In fact, Dorsey said that one of the reasons he is stepping into the interim role is that he believes Twitter's current business strategy is "right." Read More Twitter is changing how users chat privately



Jack Dorsey and Dick Costolo Justin Tallis | AFP | Getty Images; David A. Grogan | CNBC

"I don't anticipate any change in that strategy or the product direction," he said, later adding that "I believe in the course that the company is on, and the management teams ability to fulfill that and execute on it." Dorsey praised Costolo for his "good work" with the company, and the outgoing CEO shared similar plaudits. "There is no one better than Jack Dorsey to lead Twitter during this transition. He has a profound understanding of the product and Twitter's mission in the world as well as a great relationship with Twitter's leadership team," Costolo said in a release Thursday. Read MoreTwitter would be 'instant fit' for Google: Chris Sacca Dorsey previously served as CEO from May 2007 to October 2008. He noted in a release that he planned to continue to "execute our strategy while helping facilitate a smooth transition as the board conducts its search." "I think [Dorsey is] in a very strong position to help figure out where they should be going in the future," said Box CEO Aaron Levie in a CNBC "Closing Bell" interview Thursday.

At the end of last month, Costolo shrugged off rumors about his job security, saying he and the company's board were "totally in sync." His comments came weeks after Twitter's first-quarter revenue came in well below Wall Street's estimates. Costolo revealed on the call that he initiated comments with board members about leaving his CEO role at the end of last year, and that the decision was made last week. The outgoing chief explained on the call that he and the board chose Thursday to announce the transition because he felt that rumors of a CEO search would be disruptive if he were still leading the company.

In December, SunTrust's Bob Peck told CNBC that there was a "good chance" Costolo would not hold the position within a year. Some have suggested Twitter was in need of some major changes, and several commentators had suggested that the outgoing CEO was not the right leader for such a shift. Under the conditions of his departure, Costolo will not receive any severance, according to SEC filings. Twitter's most recent annual report notes that he holds more than 8 million shares, or 1.2 percent of the company's stock. Twitter CFO Anthony Noto confirmed on the call that there would be no financial impact from Costolo's departure, as he would not receive a severance package. The company also reaffirmed its second-quarter guidance in the release announcing the leadership transition. Read MoreCommentary: Here is Twitter's biggest problem With Costolo's coming exit, some are turning to whether Twitter may be up for sale. "It seems to me what would make a lot of sense right now would be to run a process and let someone else that has a bigger platform than Twitter actually buy it," Kevin O'Leary, O'Leary Financial Group chairman, said.

Costolo dismissed the notion of a sale, saying "we see no reason" why the company would be unable to maximize shareholder value on its own, adding that "the focus right now is on maximizing Twitter's value and its broad impact as an independent public company." Dorsey, who also leads financial services company Square, said he will be splitting his time between the two firms. Programming note: Costolo and Dorsey will appear on CNBC's "Squawk on the Street" at 10 a.m. EDT Friday.