diff --git a/includes/module.inc b/includes/module.inc
index 494924f..fb4c7b7 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -430,8 +430,7 @@ function module_enable($module_list, $enable_dependencies = TRUE) {
       ':name' => $module))
       ->fetchObject();
     if ($existing->status == 0) {
-      // Load the module's code.
-      drupal_load('module', $module);
+      // Load the module's install code
       module_load_install($module);
 
       // Update the database and module list to reflect the new module. This
@@ -450,6 +449,10 @@ function module_enable($module_list, $enable_dependencies = TRUE) {
       _system_update_bootstrap_status();
       // Update the registry to include it.
       registry_update();
+      /* Load the module's code; this must be done after rebuilding hook cache
+       * and registry to avoid calling hooks on modules that aren't installed yet.
+       */
+      drupal_load('module', $module);
       // Refresh the schema to include it.
       drupal_get_schema(NULL, TRUE);
       // Update the theme registry to include it.
