PurposeSevere disruptions to maritime supply chains, including port closures, congestion and shortages in shipping capacity, have occurred during the COVID-19 pandemic. This paper’s purpose is to explore flexibility-based countermeasures that enable actors in maritime supply chains to mitigate the effects of disruptions with different characteristics.Design/methodology/approachSemi-structured interviews were conducted with shipping lines, shippers, forwarders and ports. Data on the COVID-19 pandemic's effects and countermeasures were collected and compared with data regarding the 2016–2017 Gothenburg port conflict.FindingsSpatial, capacity, service and temporal flexibility emerged as the primary countermeasures, whilst important characteristics of disruptions were geographical spread, duration, uncertainty, criticality, the element of surprise and intensity. Spatial flexibility was exercised in both disruptions by switching to alternative ports. During the COVID-19 pandemic, ensuring capacity flexibility included first removing and then adding vessels. Shipping lines exercising service flexibility prioritised certain cargo, which made the spot market uncertain and reduced flexibility for forwarders, importers and exporters that changed carriers or traffic modes. Experience with disruptions meant less surprise and better preparation for spatial flexibility.Practical implicationsUnderstanding how actors in maritime supply chains exercise flexibility-based countermeasures amid disruptions with different characteristics can support preparedness for coming disruptions.Originality/valueComparing flexibility-based measures in a pandemic versus port conflict provides insights into the important characteristics of disruptions and the relevance of mitigation strategies. The resilience of maritime supply chains, although underexamined compared with manufacturing supply chains, is essential for maintaining global supply chain flows.