When oxygenic photosynthesis first evolved, the free O2 it produced probably dissolved in the surrounding water until it reached a high enough concentration to react with dissolved iron. This would have caused the iron to precipitate as iron oxide, which accumulated as sediments. These sediments were compressed into banded iron formations, red layers of rock containing iron oxide that are a source of iron ore today. Once all of the dissolved iron had precipitated, additional O2 dissolved in the water until the seas and lakes became saturated with O2. After this occurred, the O2 finally began to "gas out" of the water and enter the atmosphere.
