diff --git a/includes/environment.inc b/includes/environment.inc
index b0cb3cd..6257fb6 100644
--- a/includes/environment.inc
+++ b/includes/environment.inc
@@ -382,10 +382,18 @@ function drush_locate_root($start_path = NULL) {
  */
 function drush_valid_drupal_root($path) {
   if (!empty($path) && is_dir($path)) {
-    $candidates = array('includes/common.inc', 'core/includes/common.inc');
-    foreach ($candidates as $candidate) {
-      if (file_exists($path . '/' . $candidate)) {
-        return $candidate;
+    $candidates = array('drupal7' => 'includes/common.inc', 'drupal8' => 'core/includes/common.inc');
+    if (file_exists($path . '/' . $candidates['drupal8'])) {
+      return $candidates['drupal8'];
+    }
+    elseif (file_exists($path . '/' . $candidates['drupal7'])) {
+      // Check if we are somewhere inside the 'core' directory of a Drupal 8 installation
+      $parent_dir = _drush_shift_path_up($path);
+      if (file_exists($parent_dir . '/' . $candidates['drupal8'])) {
+        return FALSE;
+      }
+      else {
+        return $candidates['drupal8'];
       }
     }
   }
