diff --git a/entityreference_typeahead.module b/entityreference_typeahead.module
index 722bac9..218a710 100644
--- a/entityreference_typeahead.module
+++ b/entityreference_typeahead.module
@@ -379,3 +379,28 @@ function entityreference_typeahead_entityreference_typeahead_properties($entity_
   // Get all entities.
   return array();
 }
+
+ /**
+ * Implements hook_query_alter().
+ */
+ function entityreference_typeahead_query_alter(QueryAlterableInterface $query) {
+  if ($query->hasTag('typeahead_users_by_role')) {
+    $tables = $query->getTables();
+
+    // Not sure this will happen
+    if (empty($tables)) {
+      return;
+    }
+
+    if (!isset($tables['users'])) {
+      $first_table = reset($tables);
+      $alias = $first_table['alias'];
+      $query->join('users', 'users', $alias . '.entity_id = users.uid');
+    }
+    $query->join('users_roles', 'users_roles', 'users.uid = users_roles.uid');
+    $roles = $query->getMetaData('roles');
+    if (!empty($roles)) {
+      $query->condition('users_roles.rid', (array) $roles, 'IN');
+    }
+  }
+}
diff --git a/includes/typeahead_callback.inc b/includes/typeahead_callback.inc
index c62c720..e0b3f76 100644
--- a/includes/typeahead_callback.inc
+++ b/includes/typeahead_callback.inc
@@ -56,19 +56,51 @@ function entityreference_typeahead_typeahead_callback($type, $entity_type, $bund
       $query->entityCondition('bundle', $bundle);
     }
 
-    $ids = array_merge($ids, entityreference_typeahead_search_by_properties($query, $tag_last, $entity_type, $bundle));
-    $ids = array_merge($ids, entityreference_typeahead_search_by_fields($query, $tag_last, $entity_type, $bundle));
+    // Search users by roles and status.
+    if ($entity_type == 'user' && !empty($field_name)) {
+      $field_info = field_info_field($field_name);
+
+      // Filter user by status.
+      $active = $field_info['settings']['handler_settings']['referenceable_status']['active'];
+      $blocked = $field_info['settings']['handler_settings']['referenceable_status']['blocked'];
+      if ($active xor $blocked) {
+        if ($active) {
+          $query->propertyCondition('status', 1);
+        }
+        elseif ($blocked) {
+          $query->propertyCondition('status', 0);
+        }
+      }
 
-    if ($entity_type == 'user' && user_access('administer users')) {
-      // In addition, if the user is administrator, we need to make sure to
-      // match the anonymous user, that doesn't actually have a name in the
-      // database.
-      $anonymous_username = drupal_strtolower(trim(format_username(user_load(0))));
-      if (strpos($anonymous_username, $tag_last) !== FALSE) {
-        $ids[] = 0;
+      // Filter user by roles.
+      $roles = array();
+      foreach ($field_info['settings']['handler_settings']['referenceable_roles'] as $rid => $enabled) {
+        if ($enabled) {
+          $roles[] = $rid;
+        }
+      }
+      if (!empty($roles)) {
+        $query->addTag('typeahead_users_by_role');
+        $query->addMetaData('roles', $roles);
+      }
+
+      if (user_access('administer users')) {
+        // In addition, if the user is administrator, we need to make sure to
+        // match the anonymous user, that doesn't actually have a name in the
+        // database.
+        $anonymous_username = drupal_strtolower(trim(format_username(user_load(0))));
+        if (strpos($anonymous_username, $tag_last) !== FALSE) {
+          if (((!$active && !$blocked) || (($active xor $blocked) && $blocked)) && empty($roles)) {
+            // We are searching for users that have all status, or just blocked user, with no restriction to the roles.
+            $ids[] = 0;
+          }
+        }
       }
     }
 
+    $ids = array_merge($ids, entityreference_typeahead_search_by_properties($query, $tag_last, $entity_type, $bundle));
+    $ids = array_merge($ids, entityreference_typeahead_search_by_fields($query, $tag_last, $entity_type, $bundle));
+
     $ids = array_unique($ids);
   }
 
