Norwegian ships continued to use the Danish civil ensign distinguished with the national arms in the canton north of Cape Finisterre, but had to fly the Swedish civil ensign in the Mediterranean to be protected from pirate attacks. A common civil ensign for both countries was introduced in 1818, on the pattern of the naval ensign, but square-cut. This flag was optional for Swedish vessels, but compulsory for Norwegian ones in distant waters. In 1821, Norway adopted a new national civil ensign, identical to the present flag of Norway.