Facebook has apologized to President Donald Trump's social media director, Dan Scavino Jr., for temporarily restricting his account for a couple of hours due to automated bots on the platform.

In a statement obtained by Fox News, a Facebook spokesperson apologized for the error, adding that sometimes limiting repetitive, identical activity from one account can have "unintended consequences."

“In order to stop automated bots, we cap the amount of identical, repetitive activity coming from one account in a short period of time, such as @mentioning people," the spokesperson told Fox News. "These limits can have the unintended consequence of temporarily preventing real people like Dan Scavino from engaging in such activity, but lift in an hour or two, which is what happened in this case. We’ve been in touch with him and have apologized for the inconvenience.”

TRUMP SLAMS FACEBOOK, GOOGLE, TWITTER, SAYS TECH GIANTS ARE 'ON THE SIDE OF THE RADICAL LEFT DEMOCRATS'

A source familiar with the situation told Fox News that the social network is "actively working" to improve its messaging to users that may run into issues like this.

Trump took to Twitter, a platform he slammed earlier in the day for being "on the side of the radical left Democrats," to say that he would be "looking into this," though he did not explain what that meant.

On Monday night, Scavino said on Facebook that his page had been blocked without notice.

CLICK HERE TO GET THE FOX NEWS APP

Fox News' Hillary Vaughn contributed to this report.