. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Associated Press Photo

In this Wednesday, April 24, 2013, file photo, Twitter co-Founder Jack Dorsey speaks at a fundraiser in New York. Revealed in a regulatory filing on Monday, Oct. 5, 2015, Twitter is embracing Dorsey as its CEO in hopes that its once-spurned co-founder can hatch a plan to expand the short messaging service’s audience and end nearly a decade of financial losses. (AP Photo/Mary Altaffer, File)

SAN FRANCISCO (AP) — Twitter is embracing Jack Dorsey as its CEO in hopes that its once-spurned co-founder can hatch a plan to expand the short messaging service’s audience and end nearly a decade of financial losses.

The hiring revealed Monday in a regulatory filing ends Twitter’s three-month search for a new leader. It marks Dorsey’s second stint as CEO since he helped start the San Francisco company more than nine years ago with Evan Williams, Biz Stone and Noah Glass.

Twitter dumped Dorsey his first time around, but its board of directors is now convinced he has the maturity and expertise to fix the problems that have caused the company’s stock to lose nearly half its value in the past five months.

“As a founder and inventor of the product, Jack knows more about Twitter than anyone else,” said Peter Currie, the Twitter director who led the search for a new CEO.

Investors applauded the move as Twitter’s stock surged $1.84, or 7 percent, to close at $28.15.

Dorsey, 38, has already had dress rehearsal for the job, having become Twitter’s interim CEO in July after former stand-up comedian and veteran entrepreneur Dick Costolo stepped down amid shareholder discontent. Costolo is relinquishing his seat on Twitter’s board now that Dorsey is permanent CEO.

Twitter had considered its chief revenue officer, Adam Bain, and several other CEO candidates before settling on Dorsey. Bain, 42, is being promoted to chief operating officer to handle more duties as he teams up with Dorsey to try to turn Twitter into a profitable business.

“The world needs a Twitter that not only remains relevant, but thrives and continues to redefine what came before it,” Dorsey told analysts Monday during a conference call. “It is our goal to exceed the expectations that the world has for us.”

Dorsey will no longer be Twitter’s chairman, but he will continue as CEO of Square Inc., a company he co-founded in 2009, as he prepares that company for its initial public offering of stock. Twitter plans to recruit an outsider to become Twitter’s new chairman, Currie said.

In its hiring of Dorsey, Twitter’s board recanted on a pledge issued in late June when it vowed to pick a CEO who would be able to make a “full-time commitment” to the company. Currie said the board changed its mind as it watched Dorsey surpass its expectations as interim CEO and help Twitter “find a new gear under his leadership.”

As CEO of two companies simultaneously, Dorsey can draw more parallels to Apple co-founder Steve Jobs — a comparison that Dorsey has never discouraged.

After being ousted from Apple in the mid-1980s, Jobs came back as the company’s interim CEO in 1997 and then stayed on to oversee the creation of the iPod, iPhone and iPad.

While running Apple, Jobs also was CEO of computer animation pioneer Pixar until the company was sold to Disney in 2006.

The headquarters of Twitter and Square are within a block of each other, possibly making it easier for Dorsey to split his duties at the two companies.

RBC Capital Markets analyst Mark Mahaney is worried Dorsey’s dual CEO jobs will create a “more challenging environment than necessary” at Twitter.

R.W. Baird analyst Colin Sebastian said the decision is a step in the right direction for Twitter.

“We believe Dorsey has the requisite vision and organizational clout to address some of Twitter’s major challenges,” Sebastian wrote in a research note.

Dorsey’s biggest challenge at Twitter will be finding a way to make the site easier to navigate and broaden its appeal beyond media junkies, athletes, celebrities and politicians.

The short messaging service has amassed more than 300 million users but its growth has been slowing to the frustration of investors, even as people spend more time online, particularly on their smartphones.

“Currently, the product makes people do lot of work to realize the value,” Dorsey said.

Facebook has hooked 1.5 billion people on its online social network and even its photo-sharing application, Instagram, has surpassed Twitter in size. Unlike Twitter, Facebook has been making money for years and its stock has more than doubled from its IPO price. In contrast, Twitter’s stock is barely above its IPO price of $26 nearly two years after its market debut.

Dorsey should be highly motivated to lift the stock price, given he owns a 3 percent stake in Twitter currently worth about $600 million.

Dorsey might attempt to draw more traffic to Twitter and engage more people by lifting the 140-character limit that he originally imposed on tweets so they would fit under the restrictions imposed at that time on phone texting. Since Dorsey became interim CEO, Twitter already has already tossed out the 140-character limit private messages sent through Twitter.

Increasing the length of tweets, though, might alienate some of Twitter’s most loyal and active users, who have embraced the 140-character limit as an exercise in eloquence.

Dorsey must ensure that Twitter’s steadily rising revenue begins to produce profits relatively soon. Although the company generated $938 million in revenue during the first half of this year, Twitter still lost $299 million. That raised Twitter’s total losses since its inception to $1.9 billion.