diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 120bccd..16ebb97 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -1031,15 +1031,17 @@ protected function initializeSettings(Request $request) {
       $prefix = Settings::getApcuPrefix('class_loader', $this->root);
       $apc_loader = new ApcClassLoader($prefix, $this->classLoader);
       $this->classLoader->unregister();
-      $apc_loader->register();
-      $old_loader = $this->classLoader;
-      $this->classLoader = $apc_loader;
       // The optimized classloader might be persistent and store cache misses.
       // For example, once a cache miss is stored in APCu clearing it on a
       // specific web-head will not clear any other web-heads. Therefore
       // fallback to the composer class loader that only statically caches
       // misses.
-      $old_loader->register();
+      $old_loader = $this->classLoader;
+      $this->classLoader = $apc_loader;
+      // Our class loaders are preprended to ensure they come first like the
+      // class loader they are replacing.
+      $old_loader->register(TRUE);
+      $apc_loader->register(TRUE);
     }
   }
 
