After weeks of discussion over whether the micro-blogging site would name Dorsey — who already has a full-time chief executive gig at Square, his mobile payments startup — the Twitter board on Monday picked the 38-year old tech guru to lead it out of a rough patch.

Even if he’ll only be able to be a part-time CEO.

Dorsey, a co-founder of the San Francisco company, has served as its interim CEO since Dick Costolo resigned last summer. Dorsey is expected to take Square public in the coming weeks.

Twitter’s board initially had dug in against the idea of sharing Dorsey with Square, insisting on a CEO “in a position to make a full-time commitment to Twitter.”

But Dorsey’s performance in the corner office since June apparently quelled those concerns.

“Mr. Dorsey was selected to serve on the Board because of the perspective and experience he brings as one of Twitter’s founders and as one of Twitter’s largest stockholders, as well as his extensive experience with technology companies,” Twitter said in a Monday filing.

Twitter shares, down more than 25 percent this year, gained 1.7 percent Monday morning on the news, to $26.76.

Adam Bain, a 42-year-old exec in charge of Twitter’s global revenue and partnerships, who was also considered for the CEO position, is being promoted to chief operating officer.

Financial chief Anthony Noto will remain in his current job, according to the filing.

Dorsey, who won’t receive direct compensation in his new role, will give up the chairman role he has held at Twitter since 2008.

In a move that surprised some, the board didn’t name another co-founder and director, Ev Williams, to serve as chairman. Instead, it said the board would seek an outside candidate for the role.

That prompted early Monday speculation that the notoriously testy relationship between Dorsey and Williams remains volatile.

“We had anticipated [Williams] to be named chairman of the board, or at least take a more active role in product development as well,” said Suntrust analyst Robert Peck.

By all accounts, Twitter needs to upgrade its product quickly to make it more accessible. The messaging service’s user growth has stagnated just above the 300 million mark this year — while rival networks like Instagram have surged past it.

This week, Twitter is expected to unveil “Project Lightning,” a new, user-friendly feature that will make it possible to view tweets according to subject matter and alleviate the need to amass a list of accounts to follow the news.

Frustrations over user growth had helped oust Costolo from the CEO job this summer. On Monday, Twitter said Costolo is now giving up his board seat as well.