diff -rup drupal-5.1/includes/theme.inc drupal-5.1-patched/includes/theme.inc
--- drupal-5.1/includes/theme.inc	2007-01-11 03:36:06.000000000 +0000
+++ drupal-5.1-patched/includes/theme.inc	2007-02-11 15:19:46.000000000 +0000
@@ -44,9 +44,20 @@ function init_theme() {
   // list of enabled themes.
   $theme = $user->theme && $themes[$user->theme]->status ? $user->theme : variable_get('theme_default', 'garland');
 
-  // Allow modules to override the present theme... only select custom theme
-  // if it is available in the list of installed themes.
-  $theme = $custom_theme && $themes[$custom_theme] ? $custom_theme : $theme;
+  // Use the administrative theme if the user is looking at a page in the admin/* path
+  if (arg(0) == 'admin') {
+    drupal_add_css(drupal_get_path('module', 'system') . '/admin.css', 'module');
+    // if block_admin_display() in modules/block/block.module is the first caller, don't pre-empt it
+    if (!isset($custom_theme)) {
+       $custom_theme = variable_get('admin_theme', '0');
+    }
+  }
+
+  // Allow modules to override the present theme... only select custom theme                               
+  // if it is available in the list of enabled themes.
+  if ($custom_theme && $themes[$custom_theme]) {
+    $theme = $custom_theme;
+  }
 
   // Store the identifier for retrieving theme settings with.
   $theme_key = $theme;
diff -rup drupal-5.1/modules/system/system.module drupal-5.1-patched/modules/system/system.module
--- drupal-5.1/modules/system/system.module	2007-01-29 21:51:53.000000000 +0000
+++ drupal-5.1-patched/modules/system/system.module	2007-02-11 15:20:57.000000000 +0000
@@ -302,15 +302,6 @@ function system_menu($may_cache) {
       'type' => MENU_CALLBACK);
   }
   else {
-    /**
-     * Use the administrative theme if the user is looking at a page in the admin/* path.
-     */
-    if (arg(0) == 'admin') {
-      global $custom_theme;
-      $custom_theme = variable_get('admin_theme', '0');
-      drupal_add_css(drupal_get_path('module', 'system') .'/admin.css', 'module');
-    }
-
     // Add the CSS for this module. We put this in !$may_cache so it is only
     // added once per request.
     drupal_add_css(drupal_get_path('module', 'system') .'/defaults.css', 'module');
