The harbour is a drowned valley system that was carved through Miocene marine sediments of the Waitemata Group. Recent volcanism in the Auckland volcanic field has also shaped the coast, most obviously at Devonport and the Meola Reef (a lava flow which almost spans the harbour), but also in the explosion craters of Orakei Basin and in western Shoal Bay. In periods of low sea level, a tributary ran from Milford into the Shoal Bay stream. This valley provided the harbour with a second entrance when sea levels rose, until the Lake Pupuke volcano plugged this gap.