diff --git a/auth/ldap/auth.php b/auth/ldap/auth.php
index 408f460..3c832fe 100644
--- a/auth/ldap/auth.php
+++ b/auth/ldap/auth.php
@@ -1340,6 +1340,11 @@ class auth_plugin_ldap extends auth_plugin_base {
                 ldap_set_option($connresult, LDAP_OPT_PROTOCOL_VERSION, $this->config->version);
             }
 
+            // Fix MDL-10921
+            if ($this->config->user_type == 'ad') {
+                 ldap_set_option($connresult, LDAP_OPT_REFERRALS, 0);
+            }
+
             if (!empty($binddn)) {
                 //bind with search-user
                 //$debuginfo .= 'Using bind user'.$binddn.'and password:'.$bindpwd;
