diff --git bp-core/bp-core-classes.php bp-core/bp-core-classes.php
index 3ff43fd..beafe77 100644
--- bp-core/bp-core-classes.php
+++ bp-core/bp-core-classes.php
@@ -310,6 +310,11 @@ class BP_User_Query {
 					$sql['order']   = "ASC";
 				}
 
+				// Alphabetical queries ignore last_activity, while BP uses last_activity
+				// to infer spam/deleted/non-activated users. To ensure that these users
+				// are filtered out, we add an appropriate sub-query.
+				$sql['where'][] = "u.{$this->uid_name} IN ( SELECT ID FROM {$wpdb->users} WHERE " . bp_core_get_status_sql( '' ) . " )";
+
 				break;
 
 			// Any other 'type' falls through
diff --git tests/testcases/core/class-bp-user-query.php tests/testcases/core/class-bp-user-query.php
index 26d1c47..83dd47b 100644
--- tests/testcases/core/class-bp-user-query.php
+++ tests/testcases/core/class-bp-user-query.php
@@ -222,4 +222,80 @@ class BP_Tests_BP_User_Query_TestCases extends BP_UnitTestCase {
 
 		$this->assertEquals( array( $u2 ), $found_user_ids );
 	}
+
+	/**
+	 * @group type
+	 * @group spam
+	 */
+	public function test_bp_user_query_type_alphabetical_spam_xprofileon() {
+		if ( is_multisite() ) {
+			return;
+		}
+
+		// Make sure xprofile is on
+		$xprofile_toggle = isset( buddypress()->active_components['xprofile'] );
+		buddypress()->active_components['xprofile'] = 1;
+		add_filter( 'bp_disable_profile_sync', '__return_false' );
+
+		$u1 = $this->create_user();
+		$u2 = $this->create_user();
+
+		global $wpdb;
+		bp_core_process_spammer_status( $u1, 'spam' );
+
+		$q = new BP_User_Query( array( 'type' => 'alphabetical', ) );
+
+		// Restore xprofile setting
+		if ( $xprofile_toggle ) {
+			buddypress()->active_components['xprofile'] = 1;
+		} else {
+			unset( buddypress()->active_components['xprofile'] );
+		}
+		remove_filter( 'bp_disable_profile_sync', '__return_false' );
+
+		$found_user_ids = null;
+
+		if ( ! empty( $q->results ) ) {
+			$found_user_ids = array_values( wp_parse_id_list( wp_list_pluck( $q->results, 'ID' ) ) );
+		}
+
+		// Do a assertNotContains because there are weird issues with user #1 as created by WP
+		$this->assertNotContains( $u1, $found_user_ids );
+	}
+
+	/**
+	 * @group type
+	 * @group spam
+	 */
+	public function test_bp_user_query_type_alphabetical_spam_xprofileoff() {
+		$u1 = $this->create_user();
+		$u2 = $this->create_user();
+
+		// Make sure xprofile and profile sync are off
+		$xprofile_toggle = isset( buddypress()->active_components['xprofile'] );
+		buddypress()->active_components['xprofile'] = 0;
+		add_filter( 'bp_disable_profile_sync', '__return_false' );
+
+		bp_core_process_spammer_status( $u1, 'spam' );
+
+		$q = new BP_User_Query( array( 'type' => 'alphabetical', ) );
+
+		// Restore xprofile setting
+		if ( $xprofile_toggle ) {
+			buddypress()->active_components['xprofile'] = 1;
+		} else {
+			unset( buddypress()->active_components['xprofile'] );
+		}
+		remove_filter( 'bp_disable_profile_sync', '__return_false' );
+
+		$found_user_ids = null;
+
+		if ( ! empty( $q->results ) ) {
+			$found_user_ids = array_values( wp_parse_id_list( wp_list_pluck( $q->results, 'ID' ) ) );
+		}
+
+		// Do a assertNotContains because there are weird issues with user #1 as created by WP
+		$this->assertNotContains( $u1, $found_user_ids );
+	}
+
 }
