diff --git a/core/includes/batch.inc b/core/includes/batch.inc
index 088889d..81aa417 100644
--- a/core/includes/batch.inc
+++ b/core/includes/batch.inc
@@ -15,6 +15,7 @@
  */
 
 use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Timer;
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Core\Batch\Percentage;
@@ -23,6 +24,7 @@
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RedirectResponse;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 
 /**
  * Renders the batch processing page based on the current state of the batch.
@@ -43,8 +45,7 @@ function _batch_page(Request $request) {
   if (!$batch) {
     $batch = \Drupal::service('batch.storage')->load($request_id);
     if (!$batch) {
-      drupal_set_message(t('No active batch.'), 'error');
-      return new RedirectResponse(\Drupal::url('<front>', [], ['absolute' => TRUE]));
+      throw new NotFoundHttpException(String::format('Page controller for batch %id requested, but batch was not found.', array('%id' => $request_id)));
     }
   }
   // Restore safe strings from previous batches.
diff --git a/core/tests/Drupal/Tests/Core/Batch/BatchNotFoundTest.php b/core/tests/Drupal/Tests/Core/Batch/BatchNotFoundTest.php
new file mode 100644
index 0000000..c33b2cc
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/Batch/BatchNotFoundTest.php
@@ -0,0 +1,53 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Tests\Core\Batch\BatchNotFoundTest.
+ */
+
+namespace Drupal\Tests\Core\Batch;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests if Drupal returns page not found error when batch Id does not exist.
+ *
+ * @group Batch
+ */
+class BatchNotFoundTest extends WebTestBase {
+
+  /**
+   * The main user for testing.
+   *
+   * @var object
+   */
+  protected $user;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    $this->user = $this->drupalCreateUser();
+  }
+
+  /**
+   * Tests for page not found error if batch ID does not exist.
+   */
+  function testBatchNotFound() {
+    $this->drupalLogin($this->user);
+
+    $batch_id = mt_rand(0, 1000);
+
+    $this->drupalGet('batch', array(
+      'query' => array(
+        'op' => 'start',
+        'id' => $batch_id,
+      ),
+    ));
+
+    $this->assertResponse(404, 'The requested page could not be found. ');
+  }
+
+}
