diff --git a/lib/master.pike.in b/lib/master.pike.in
index 29e3bb5ede46b758fc95601b737afc4877683121..1cbf53f66031c9965fa119f5437b390870f4fc54 100644
--- a/lib/master.pike.in
+++ b/lib/master.pike.in
@@ -3760,6 +3760,14 @@ void _main(array(string(0..255)) orig_argv)
     }
 
     cur_compat_ver = Version (compat_major, compat_minor);
+    if (cur_compat_ver < lowestcompat)
+    {
+      werror("This Pike only supports compatibility down to %s.\n",
+             (string)lowestcompat);
+      cur_compat_ver = lowestcompat;
+      compat_major = lowestcompat->major;
+      compat_minor = lowestcompat->minor;
+    }
     if (compat_major != -1) {
       object compat_master = get_compat_master (compat_major, compat_minor);
 
@@ -5873,6 +5881,9 @@ class Version
 //! Version information about the current Pike version.
 Version currentversion = Version(__REAL_MAJOR__, __REAL_MINOR__);
 
+Version lowestcompat = Version(Builtin.LOWEST_COMPAT_MAJOR,
+                               Builtin.LOWEST_COMPAT_MINOR);
+
 mapping(Version:CompatResolver) compat_handler_cache = ([
   currentversion:this_object(),
 ]);
diff --git a/src/builtin_functions.c b/src/builtin_functions.c
index bc735083bb44ebfdb9bc4f3423ac994266ae0962..8037dcf96c106a2d241b561cd0f19aeb16a13da3 100644
--- a/src/builtin_functions.c
+++ b/src/builtin_functions.c
@@ -10374,6 +10374,9 @@ void init_builtin_efuns(void)
   ADD_INT_CONSTANT ("DESTRUCT_NO_REFS", DESTRUCT_NO_REFS, 0);
   ADD_INT_CONSTANT ("DESTRUCT_GC", DESTRUCT_GC, 0);
   ADD_INT_CONSTANT ("DESTRUCT_CLEANUP", DESTRUCT_CLEANUP, 0);
+
+  ADD_INT_CONSTANT("LOWEST_COMPAT_MAJOR", LOWEST_COMPAT_MAJOR, 0);
+  ADD_INT_CONSTANT("LOWEST_COMPAT_MINOR", LOWEST_COMPAT_MINOR, 0);
 }
 
 void exit_builtin_efuns(void)
diff --git a/src/version.h b/src/version.h
index b49c5e1a214cdaf7e6312ca9b359f150a3a54e17..988f4e159ac9ccb481e9474a17636056a3cfb5cd 100644
--- a/src/version.h
+++ b/src/version.h
@@ -8,6 +8,9 @@
 #define PIKE_MINOR_VERSION 0
 #define PIKE_BUILD_VERSION 3
 
+#define LOWEST_COMPAT_MAJOR 0
+#define LOWEST_COMPAT_MINOR 5
+
 /* Prototypes begin here */
 PMOD_EXPORT void f_version(INT32 args);
 void push_compact_version();