diff --git a/core/modules/workflows/src/Plugin/WorkflowTypeBase.php b/core/modules/workflows/src/Plugin/WorkflowTypeBase.php
index 0c4a34f..5324154 100644
--- a/core/modules/workflows/src/Plugin/WorkflowTypeBase.php
+++ b/core/modules/workflows/src/Plugin/WorkflowTypeBase.php
@@ -229,15 +229,20 @@ public function deleteState($state_id) {
     }
 
     foreach ($this->configuration['transitions'] as $transition_id => $transition) {
+      if ($transition['to'] === $state_id) {
+        $this->deleteTransition($transition_id);
+        continue;
+      }
       $from_key = array_search($state_id, $transition['from'], TRUE);
       if ($from_key !== FALSE) {
         // Remove state from the from array.
         unset($transition['from'][$from_key]);
-      }
-      if (empty($transition['from']) || $transition['to'] === $state_id) {
-        $this->deleteTransition($transition_id);
-      }
-      elseif ($from_key !== FALSE) {
+        if (empty($transition['from'])) {
+          // There are no more 'from' entries, remove the transition.
+          $this->deleteTransition($transition_id);
+          continue;
+        }
+        // We changed the from state, update the transition.
         $this->setTransitionFromStates($transition_id, $transition['from']);
       }
     }
diff --git a/core/modules/workflows/tests/src/Unit/WorkflowTest.php b/core/modules/workflows/tests/src/Unit/WorkflowTest.php
index e2adf95..15e41d3 100644
--- a/core/modules/workflows/tests/src/Unit/WorkflowTest.php
+++ b/core/modules/workflows/tests/src/Unit/WorkflowTest.php
@@ -210,14 +210,18 @@ public function testDeleteState() {
     $workflow_type
       ->addState('draft', 'Draft')
       ->addState('published', 'Published')
+      ->addState('archived', 'Archived')
       ->addTransition('publish', 'Publish', ['draft', 'published'], 'published')
-      ->addTransition('create_new_draft', 'Create new draft', ['draft', 'published'], 'draft');
-    $this->assertCount(2, $workflow_type->getStates());
-    $this->assertCount(2, $workflow_type->getState('published')->getTransitions());
+      ->addTransition('create_new_draft', 'Create new draft', ['draft', 'published'], 'draft')
+      ->addTransition('archive', 'Archive', ['draft', 'published'], 'archived');
+    $this->assertCount(3, $workflow_type->getStates());
+    $this->assertCount(3, $workflow_type->getState('published')->getTransitions());
     $workflow_type->deleteState('draft');
     $this->assertFalse($workflow_type->hasState('draft'));
-    $this->assertCount(1, $workflow_type->getStates());
-    $this->assertCount(1, $workflow_type->getState('published')->getTransitions());
+    $this->assertCount(2, $workflow_type->getStates());
+    $this->assertCount(2, $workflow_type->getState('published')->getTransitions());
+    $workflow_type->deleteState('published');
+    $this->assertCount(0, $workflow_type->getTransitions());
   }
 
   /**
