diff --git a/testsuite/citest.py b/testsuite/citest.py
index e5113238..884e7375 100644
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -231,6 +231,35 @@ class RepositoryTest(CIBaseTest):
             self.assertIn(package, packages,
                           f"{package} is missing from isar-apt")
 
+    def test_repository_premirror(self):
+        """
+        Test that DISTRO_APT_PREMIRRORS do not end up in the image.
+        """
+        target = 'mc:qemuamd64-trixie:isar-image-base'
+        mirror = 'debian.inf.tu-dresden.de'
+
+        self.init()
+        self.perform_build_test(
+            [target],
+            lines=[
+                'IMAGE_FSTYPES = "tar.zst"',
+                'DISTRO_APT_PREMIRRORS:prepend = '
+                f'"http://deb\\.debian\\.org http://{mirror}\\n"',
+            ],
+        )
+
+        deploy_dir, image = CIUtils.getVars(
+            'DEPLOY_DIR_IMAGE', 'IMAGE_FULLNAME', target=target
+        )
+        sources = process.run(
+            f'tar --zstd -xOf {deploy_dir}/{image}.tar.zst '
+            './etc/apt/sources.list.d/0000bootstrap.list'
+        ).stdout_text
+        self.assertIn('deb.debian.org', sources)
+        self.assertNotIn(
+            mirror, sources, "DISTRO_APT_PREMIRRORS leaked into the image"
+        )
+
 
 class SbuildFlavor(CIBaseTest):
     """
