The Race to the Sea was the last mobile phase of the war on the Western Front until the German Spring Offensive in 1918. It arose when the Allied advance after the First Battle of the Marne was halted by well-fortified German defences at the Battle of the Aisne. Each side tried to break the ensuing stalemate by outflanking the other to the north in the direction of the Channel. As each attempt was repelled, trenches were dug by the defending side. By the beginning of November, opposing lines of trenches snaked upwards all the way to the Belgian port of Nieuport. Blocked to the north, the new German Chief of Staff switched to the southern flank and probed repeatedly for a breakthrough. The process continued and more trenches were dug. By the end of November, trench lines extended for 400 unbroken miles (644 km), from the Channel to the Swiss border.