diff --git a/core/modules/config/lib/Drupal/config/ConfigStorageController.php b/core/modules/config/lib/Drupal/config/ConfigStorageController.php
index 4c4884c..38c881f 100644
--- a/core/modules/config/lib/Drupal/config/ConfigStorageController.php
+++ b/core/modules/config/lib/Drupal/config/ConfigStorageController.php
@@ -283,18 +283,18 @@ class ConfigStorageController implements EntityStorageControllerInterface {
       $config->set($name, $entity->$name);
     }
 
-    if (!$config->isNew()) {
+    if ($config->isNew()) {
       $return = SAVED_NEW;
       $config->save();
       $this->postSave($entity, TRUE);
-      $this->invokeHook('update', $entity);
+      $this->invokeHook('insert', $entity);
     }
     else {
       $return = SAVED_UPDATED;
       $config->save();
       $entity->enforceIsNew(FALSE);
       $this->postSave($entity, FALSE);
-      $this->invokeHook('insert', $entity);
+      $this->invokeHook('update', $entity);
     }
 
     unset($entity->original);
