Jack Dorsey has resigned as the chief executive of Twitter, posting a message to the platform that it was “finally time for me to leave”.

In a statement posted to his personal Twitter account, Mr Dorsey said he was “really sad… yet really happy” to be leaving the firm he co-founded in 2006.

Confirming his replacement would be current chief technology officer Parag Agrawal, Mr Dorsey said he would continue to serve on the company’s board until spring 2022 to aid the transition before leaving the firm completely.

As well as his role at Twitter, Mr Dorsey is the founder and chief executive of the payment business Square.

He previously left Twitter in 2008, before rejoining in 2011 and then becoming chief executive for the second time in 2015.

In his message to Twitter staff he said: “After almost 16 years of having a role at our company… from co-founder to CEO to Chair to Exec Chair to interim-CEO to CEO… I’ve decided it’s finally time for me to leave.”

He added: “I want you all to know that this was my decision and I own it. It was a tough one for me, of course. I love this service and company… and all of you so much.

“I’m really sad… yet really happy. There aren’t many companies that get to this level. And there aren’t many founders that choose their company over their own ego. I know we’ll prove this was the right move.”

He said his replacement Mr Agrawal agreeing to take on the role was one of the reasons behind his departure, saying he was “my choice for some time given how deeply he understands the company and its needs”.

“Parag has been behind every critical decision that helped turn this company around,” he added.

“He’s curious, probing, rational, creative, demanding, self-aware and humble. He leads with heart and soul, and is someone I learn from daily.

“My trust in him as our CEO is bone deep.”

In his own post, new chief executive Mr Agrawal said he had “so much excitement for the future”.

“I look forward to building on everything we have accomplished under Jack’s leadership and I am incredibly energised by the opportunities ahead,” he added in a further statement.

“By continuing to improve our execution, we will deliver tremendous value for our customers and shareholders as we reshape the future of public conversation.”

Mr Dorsey had previously come under pressure from Paul Singer, the billionaire founder of hedge fund Elliott, to step down again as the company’s chief executive.

Last year Elliott and Mr Singer said that Mr Dorsey should not be chief executive of both Square and Twitter, before reaching a deal with the technology firm.

The social media giant, along with the wider sector, has also faced continuing scrutiny over its moderation of harmful content online, including how it handles misinformation as well as racist and other abusive posts.

Many campaigners have called for more regulation of the sector and greater accountability of senior managers at internet companies.

Twitter has not commented further on the announcement.

Before announcing his departure, Mr Dorsey had last tweeted on Sunday, saying simply: “I love Twitter.”