diff --git a/bleach/html5lib_shim.py b/bleach/html5lib_shim.py
index f083db75..e8027017 100644
--- a/bleach/html5lib_shim.py
+++ b/bleach/html5lib_shim.py
@@ -346,6 +346,37 @@ def __iter__(self):
last_error_token = None
yield token
+ elif (
+ last_error_token["data"]
+ in (
+ "invalid-character-in-attribute-name",
+ "invalid-character-after-attribute-name",
+ )
+ and token["type"] == TAG_TOKEN_TYPE_CHARACTERS
+ and token.get("data")
+ and " " in token["data"]
+ ):
+ # token["data"] has something that starts with a left angle
+ # bracket, then has some characters followed by a space
+ # followed by another left angle bracket and ending with
+ # a right angle bracket. That part could be a real tag, so
+ # we don't want it to get treated as Characters. For
+ # example, soemthing in this shape: