diff --git a/typo3/sysext/frontend/Classes/ContentObject/Exception/ProductionExceptionHandler.php b/typo3/sysext/frontend/Classes/ContentObject/Exception/ProductionExceptionHandler.php
index b9d5c3ab3583208cabc561bcf5e51067b3e9173b..ac261dafb2fe1768f9017d79d064f0eb25f8fd95 100644
--- a/typo3/sysext/frontend/Classes/ContentObject/Exception/ProductionExceptionHandler.php
+++ b/typo3/sysext/frontend/Classes/ContentObject/Exception/ProductionExceptionHandler.php
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Frontend\ContentObject\Exception;
 use Psr\Log\LoggerAwareInterface;
 use Psr\Log\LoggerAwareTrait;
 use TYPO3\CMS\Core\Crypto\Random;
+use TYPO3\CMS\Core\Http\ImmediateResponseException;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Frontend\ContentObject\AbstractContentObject;
 
@@ -54,6 +55,11 @@ class ProductionExceptionHandler implements ExceptionHandlerInterface, LoggerAwa
      */
     public function handle(\Exception $exception, AbstractContentObject $contentObject = null, $contentObjectConfiguration = [])
     {
+        // ImmediateResponseException should work similar to exit / die and must therefore not be handled by this ExceptionHandler.
+        if ($exception instanceof ImmediateResponseException) {
+            throw $exception;
+        }
+
         if (!empty($this->configuration['ignoreCodes.'])) {
             if (in_array($exception->getCode(), array_map('intval', $this->configuration['ignoreCodes.']), true)) {
                 throw $exception;
diff --git a/typo3/sysext/frontend/Tests/Unit/ContentObject/Exception/ProductionExceptionHandlerTest.php b/typo3/sysext/frontend/Tests/Unit/ContentObject/Exception/ProductionExceptionHandlerTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..bc7bb89424ad58293ba542c663d7e23dfa8a4ca2
--- /dev/null
+++ b/typo3/sysext/frontend/Tests/Unit/ContentObject/Exception/ProductionExceptionHandlerTest.php
@@ -0,0 +1,56 @@
+<?php
+declare(strict_types = 1);
+
+namespace TYPO3\CMS\Frontend\Tests\Unit\ContentObject\Exception;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use Psr\Log\NullLogger;
+use TYPO3\CMS\Core\Http\HtmlResponse;
+use TYPO3\CMS\Core\Http\ImmediateResponseException;
+use TYPO3\CMS\Frontend\ContentObject\Exception\ProductionExceptionHandler;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
+
+/**
+ * Test case
+ */
+class ProductionExceptionHandlerTest extends UnitTestCase
+{
+    /**
+     * @var ProductionExceptionHandler
+     */
+    protected $subject;
+
+    /**
+     * Sets up this test case.
+     */
+    protected function setUp(): void
+    {
+        $this->subject = new ProductionExceptionHandler();
+        $this->subject->setLogger(new NullLogger());
+    }
+    /**
+     * @test
+     */
+    public function relayImmediateResponseException()
+    {
+        $response = $this->getMockBuilder(HtmlResponse::class)
+            ->disableOriginalConstructor()
+            ->getMock();
+        $exception = new ImmediateResponseException($response, 1533939251);
+
+        $this->expectException(ImmediateResponseException::class);
+        $this->subject->handle($exception);
+    }
+}