About 14 million Facebook users who thought they were posting a message just to friends or smaller groups may have actually been sharing it widely with the general public due to a software bug, the company said Thursday.

A Facebook user's post typically defaults to a preselected privacy setting. However, a bug that was active from May 18 to May 27 changed posts to automatically be public.

The posts were clearly marked as public, but users who were used to their privacy settings could have easily overlooked the public designation.

The company said it went back and recategorized the affected posts to the user's default setting before the bug, and the problem has been fixed. In addition, Facebook will notify the 14 million users who could have been affected starting Thursday with an alert in their notifications.

"Starting today we are letting everyone affected know and asking them to review any posts they made during that time," chief privacy officer Erin Egan said in a statement.

"We'd like to apologize for this mistake," Egan said.