McDonald's Twitter account hacked
A message to Donald Trump appears on the McDonald's Twitter account timeline -- which McDonald's said was hacked -- in a screen capture March 16, 2017.REUTERS/TV

American fast food restaurant chain McDonald's said that its corporate Twitter account was hacked on Thursday after a tweet was posted from the company's official handle insulting the US President Donald Trump.

Although the tweet was quickly removed, its short lifespan was enough for active Twitter users to copy and share it widely before it was deleted. After an initial investigation, the social network said that an unidentified external source was behind the security breach.

"Based on our investigation, we have determined that our Twitter account was hacked by an external source. We took swift action to secure it, and we apologize this tweet was sent through our corporate McDonald's account," McDonald's said.

After the anti-Trump post went viral, McDonald's sent out a tweet saying that Twitter notified the company that its account had been hacked, and that it had taken required measures to secure the account.

The tweet sent from @McDonaldsCorp on Thursday morning read: "@realdonaldtrump You are actually a disgusting excuse of a President and we would love to have @BarackObama back, also you have tiny hands."

The message criticizing Trump set Twitter on fire after it was shared hundreds of times with more jokes and comments. The company's corporate Twitter account is followed by about 155,000 people while its main account has nearly 3.39 million followers.

Twitter implements a two-factor authentication to better defend against hacking attempts to hijack an account. While the latest hack raised questions about Twitter's security level, analysts believe that the breach was not intended to harm the restaurant chain's brand.

"As long as Trump doesn't tweet at them directly, which could be pretty disastrous, this will be a short-term thing for them," Mike Froggatt, director of intelligence at L2, told Reuters. "Twitter trending topics last for maybe 6 hours, a backlash for 10 to 12 hours and then it goes and the herd moves on."

Thursday's hack came a day after hundreds of Twitter accounts, including those of some major news organizations, chief executives, government agencies and other high-profile users, were compromised to post anti-Nazi messages in Turkish.

Twitter later said on Wednesday that hackers exploited a third-party app, whose permissions have since been revoked.