diff --git a/CHANGES b/CHANGES
index 82ed8276b1de0ea2cf1cfb3d0fb744d43295c786..94fab916101e95df64f1d5eec95fc69a7c920242 100644
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,7 @@ OpenLDAP 2.4.14 Engineering
 	Added libldap option to disable SASL host canonicalization (ITS#5812)
 	Fixed libldap deref handling (ITS#5768)
 	Fixed libldap peer cert memory leak (ITS#5849)
+	Fixed libldap intermediate response behavior (ITS#5896)
 	Fixed libldap_r deref building (ITS#5768)
 	Fixed libldap_r slapd lockup when paused during shutdown (ITS#5841)
 	Added slapd syncrepl default retry setting (ITS#5825)
diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c
index cc0fc00d09ddd177b4bd111a36a3a14d666670f3..10ca5b7d3c4131a90c7501827b9246fbb7d5c0f2 100644
--- a/libraries/libldap/result.c
+++ b/libraries/libldap/result.c
@@ -1127,7 +1127,8 @@ nextresp2:
 	if ( msgid == LDAP_RES_ANY || id == msgid ) {
 		if ( all == LDAP_MSG_ONE
 			|| ( newmsg->lm_msgtype != LDAP_RES_SEARCH_RESULT
-			    	&& newmsg->lm_msgtype != LDAP_RES_SEARCH_ENTRY
+				&& newmsg->lm_msgtype != LDAP_RES_SEARCH_ENTRY
+				&& newmsg->lm_msgtype != LDAP_RES_INTERMEDIATE
 			  	&& newmsg->lm_msgtype != LDAP_RES_SEARCH_REFERENCE ) )
 		{
 			*result = newmsg;