In 1626, the Swedes under the command of Gustav II Adolf, using modern artillery, captured the castle in two days and stayed there for several years.