diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index 396061a7515c1dcd8371af5d291451ee3437c58c..94bd8ae754e7229e397e76c33182d5b785946947 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -11398,12 +11398,18 @@ PUGI__NS_BEGIN
 			{
 				_lexer.next();
 
+				if (_lexer.current() == lex_open_square_brace)
+					return error("Predicates are not allowed after an abbreviated step");
+
 				return alloc_node(ast_step, set, axis_self, nodetest_type_node, 0);
 			}
 			else if (_lexer.current() == lex_double_dot)
 			{
 				_lexer.next();
 
+				if (_lexer.current() == lex_open_square_brace)
+					return error("Predicates are not allowed after an abbreviated step");
+
 				return alloc_node(ast_step, set, axis_parent, nodetest_type_node, 0);
 			}