New York CNN Business  — 

Jack Dorsey just survived a major threat to his leadership at Twitter.

On Monday, Twitter (TWTR) and activist hedge fund Elliott Management announced they had reached an agreement that keeps Dorsey at the helm of the social network.

Late last month, Elliott obtained a large stake in Twitter and advocated for changes, including possibly replacing Dorsey, a source familiar with the matter previously confirmed to CNN Business. Dorsey is also the CEO of payments company Square (SQ), and those two jobs were one issue that came up.

As part of the agreement, Twitter will add two new members to its board of directors and receive a $1 billion investment from investor Silver Lake. Twitter also expects to undertake a $2 billion share repurchase program.

“I am looking forward to working with Jack and the Board to help contribute to realizing Twitter’s full potential,” Jesse Cohn, partner at Elliott, said in a statement Monday.

Dorsey co-founded Twitter and Square, both of which are publicly traded companies. He served as Twitter’s first CEO before being pushed out in 2008. He returned to the post in 2015 and has remained in it since.

Dorsey has come under pressure before. Protestors accused him of being “complicit” after President Donald Trump tweeted about his nuclear button being “much bigger and more powerful” than North Korea’s. He’s faced claims from Trump and others about “discriminatory” behavior toward conservative users. He’s also steered Twitter through a rough patch when it was struggling with shrinking user numbers and revenue.

But he has survived each time.

Dorsey has a daily juggling act as he balances leading two companies. He spends mornings at Twitter and afternoons at Square. (Twitter and Square’s San Francisco offices are located essentially across the street from each other.) Beyond managing both companies, Dorsey had also planned to live in Africa for a few months this year.

Last week, he said he would reevaluate those plans. While he cited concerns about the novel coronavirus as his reason, perhaps it helped heal the rift with Elliott, too.

In addition to the new board appointments and potential share buybacks, Twitter said Monday it is looking to increase revenue growth. At the same time, Twitter is setting a goal of growing its “monetizeable” daily active users by 20% or more, roughly in line with its recent growth rates.

The Twitter board is also planning to create a temporary committee to help evaluate Twitter’s leadership structure. “As a Board, we regularly review and evaluate how Twitter is run,” Patrick Pichette, lead independent director of the Twitter Board, said in a statement. “And while our CEO structure is unique, so is Jack and so is this Company.”