Hackers broke into thousands of Dropbox Inc. accounts last month, viewing and downloading material users kept on the cloud-storage platform, according to a company statement and records seen by Bloomberg News.

About 5,000 Dropbox accounts were compromised by the hackers, who accessed files on less than a third of them, spokesperson Tim Rathschmidt said in an email. When Dropbox learned of the issue, it moved to secure the accounts, he said, adding that the company has since notified regulators and affected users.

Shares of Dropbox fell as much as 6.6% in postmarket trading on Tuesday.

Some Dropbox users received an …