diff --git a/src/dehacked.c b/src/dehacked.c
index 8220f5aa3f4391317a660b9935019ef253ff61b8..8b4b924941a9128f2516a54ecd1636032baac7e7 100644
--- a/src/dehacked.c
+++ b/src/dehacked.c
@@ -1629,6 +1629,11 @@ static void readlevelheader(MYFILE *f, INT32 num)
 					mapheaderinfo[num-1]->typeoflevel = tol;
 				}
 			}
+			else if (fastcmp(word, "KEYWORD"))
+			{
+				deh_strlcpy(mapheaderinfo[num-1]->keyword, word2,
+						sizeof(mapheaderinfo[num-1]->keyword), va("Level header %d: keyword", num));
+			}
 			else if (fastcmp(word, "MUSIC"))
 			{
 				if (fastcmp(word2, "NONE"))
diff --git a/src/doomstat.h b/src/doomstat.h
index 7e961677fb3221d51ca6fa3e71a4d967836b993d..0fad811d9d15495172e25113ddeaf8dcdfe0ac8f 100644
--- a/src/doomstat.h
+++ b/src/doomstat.h
@@ -289,6 +289,7 @@ typedef struct
 	UINT8 actnum;          ///< Act number or 0 for none.
 	UINT32 typeoflevel;    ///< Combination of typeoflevel flags.
 	INT16 nextlevel;       ///< Map number of next level, or 1100-1102 to end.
+	char keyword[33];      ///< Keywords separated by space to search for. 32 characters.
 	char musname[7];       ///< Music track to play. "" for no music.
 	UINT16 mustrack;       ///< Subsong to play. Only really relevant for music modules and specific formats supported by GME. 0 to ignore.
 	UINT32 muspos;    ///< Music position to jump to.
diff --git a/src/g_game.c b/src/g_game.c
index f7778df8f25304906e36ab7a30083d36556ccab5..45730adaccea4948db459d05445780bf7c1da287 100644
--- a/src/g_game.c
+++ b/src/g_game.c
@@ -4761,6 +4761,9 @@ INT32 G_FindMap(const char *mapname, char **foundmapnamep,
 				measurekeywords(&freq[freqc],
 						&freq[freqc].matchd, &freq[freqc].matchc,
 						realmapname, mapname, wanttable);
+				measurekeywords(&freq[freqc],
+						&freq[freqc].keywhd, &freq[freqc].keywhc,
+						mapheaderinfo[i]->keyword, mapname, wanttable);
 				if (freq[freqc].total)
 					freqc++;
 			}
diff --git a/src/lua_maplib.c b/src/lua_maplib.c
index 309ba86a112dcae1efbbba40bc3850ff10b802e3..64e60c99ab30da6bf38ee10f1df727590c377699 100644
--- a/src/lua_maplib.c
+++ b/src/lua_maplib.c
@@ -2014,6 +2014,8 @@ static int mapheaderinfo_get(lua_State *L)
 		lua_pushinteger(L, header->typeoflevel);
 	else if (fastcmp(field,"nextlevel"))
 		lua_pushinteger(L, header->nextlevel);
+	else if (fastcmp(field,"keyword"))
+		lua_pushstring(L, header->keyword);
 	else if (fastcmp(field,"musname"))
 		lua_pushstring(L, header->musname);
 	else if (fastcmp(field,"mustrack"))
diff --git a/src/p_setup.c b/src/p_setup.c
index 104b4e5a01fbe6af06c42cd58fba3487e3518dcb..a9585d0c2662154e964a5c305ff2b30664be8075 100644
--- a/src/p_setup.c
+++ b/src/p_setup.c
@@ -222,6 +222,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
 	mapheaderinfo[num]->typeoflevel = 0;
 	mapheaderinfo[num]->nextlevel = (INT16)(i + 1);
 	mapheaderinfo[num]->startrings = 0;
+	mapheaderinfo[num]->keyword[0] = '\0';
 	snprintf(mapheaderinfo[num]->musname, 7, "%sM", G_BuildMapName(i));
 	mapheaderinfo[num]->musname[6] = 0;
 	mapheaderinfo[num]->mustrack = 0;