diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h
index 72ba73007cf..5b2186ec25b 100644
--- a/storage/innobase/include/trx0sys.h
+++ b/storage/innobase/include/trx0sys.h
@@ -956,6 +956,10 @@ class trx_sys_t
     return found;
   }
 
+  bool find_same_or_older(trx_id_t id)
+  {
+    return rw_trx_hash.iterate(nullptr, find_same_or_older_callback, &id);
+  }
 
   /**
     Determines the maximum transaction id.
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc
index 349dd09917d..30f13684813 100644
--- a/storage/innobase/row/row0purge.cc
+++ b/storage/innobase/row/row0purge.cc
@@ -956,6 +956,15 @@ static trx_id_t row_purge_remove_sec_if_poss_leaf(purge_node_t *node,
                             == DB_FAIL) {
 				page_max_trx_id = page_get_max_trx_id(
 					btr_cur_get_page(btr_cur));
+				/* If the current or any older transaction is
+				active, it could modify the page without
+				changing PAGE_MAX_TRX_ID. For such cases we
+				cannot skip the check later during pessimistic
+				delete. */
+				if (trx_sys.find_same_or_older(
+					page_max_trx_id)) {
+					page_max_trx_id = ~trx_id_t{0};;
+				}
                         }
 		}
 
