Direct messages sent on Twitter will be end-to-end encrypted - this means private messages can only be read by the sender and the recipient.
Chief executive Elon Musk said it meant he could not see users' messages "even if there was a gun to my head".
But he warned that this is an early version, and people should "try it, but don't trust it yet".
The feature is not yet open to everyone, and can only be used by people who pay for Twitter Blue or are affiliated to a verified Twitter account.
It is also not yet possible to send media in the messages - users can only send text and links.
In a post on its support site, Twitter said it was "not quite there yet" with encryption.
"While messages themselves are encrypted, metadata (recipient, creation time, etc) are not, and neither is any linked content," it said.
"If someone - for example, a malicious insider, or Twitter itself as a result of a compulsory legal process - were to compromise an encrypted conversation, neither the sender or receiver would know."
When he bought Twitter in 2022, Mr Musk hinted at plans to turn it into a "super-app" with multiple functions. In China the super-app WeChat can be used for everything from social media and ordering food to payments and messaging, but there is not really a comparable platform in the West.
Since then he has made a number of dramatic changes to the social network, including the introduction of a subscription service, and the removal of old blue tick badges, previously used by Twitter as a tool in the fight against the spread of disinformation.
Many Twitter users have called for its private messaging service to be made more secure for a long time. However, Mr Musk's timing could prove awkward for him in the UK, where the government's Online Safety Bill will introduce new requirements for social media companies, which it says will help to protect children from abuse.
Messaging platforms WhatsApp and Signal have both criticised this part of the Online Safety Bill, currently near the end of its journey through Parliament.
In April, they said they were concerned the legislation could undermine end-to-end encryption, which is considered by privacy campaigners and activists to be an invaluable tool.
They were two of several messaging services whose heads signed a letter calling for a rethink, saying the bill, in its current form, opens the door to "routine, general and indiscriminate surveillance" of personal messages.
Facebook's parent company Meta has introduced encryption to its Messenger platform with some exceptions, including Marketplace chats.
Mr Musk said he expected encrypted messaging on Twitter "to grow in sophistication rapidly".
Cyber-security expert Jake Moore, from ESET, said Twitter was responding to demand from privacy-conscious users.
"Without the use of end-to-end encrypted messaging, Twitter staff and the company itself have the opportunity to read people's messages," he told the BBC.
"Although this can reap huge rewards for the platform, with advertisers being able to micro-target users, it is a huge security risk to those messaging without such privacy protection."
A Home Office spokesperson told the BBC: "The Online Safety Bill applies to all platforms, regardless of their design and functionality. Therefore, end-to-end encrypted services are in scope and will be required to meet their duties of care to users.
"We have made clear that companies should only implement end-to-end encryption if they can simultaneously uphold public safety. We continue to work with the tech industry to collaborate on mutually agreeable solutions that protect public safety without compromising security."