diff --git a/core/lib/Drupal/Core/Controller/ExceptionController.php b/core/lib/Drupal/Core/Controller/ExceptionController.php
index 12e9cbe..6faec42 100644
--- a/core/lib/Drupal/Core/Controller/ExceptionController.php
+++ b/core/lib/Drupal/Core/Controller/ExceptionController.php
@@ -148,6 +148,7 @@ public function on403Html(FlattenException $exception, Request $request) {
       else {
         $subrequest = Request::create($request->getBaseUrl() . '/' . $path, 'GET', array('destination' => $system_path, '_exception_statuscode' => 403), $request->cookies->all(), array(), $request->server->all());
       }
+      $subrequest->attributes->set('exception', $request->attributes->get('exception'));
 
       $response = $this->container->get('http_kernel')->handle($subrequest, HttpKernelInterface::SUB_REQUEST);
       $response->setStatusCode(403, 'Access denied');
@@ -208,6 +209,7 @@ public function on404Html(FlattenException $exception, Request $request) {
       else {
         $subrequest = Request::create($request->getBaseUrl() . '/' . $path, 'GET', array('destination' => $system_path, '_exception_statuscode' => 404), $request->cookies->all(), array(), $request->server->all());
       }
+      $subrequest->attributes->set('exception', $request->attributes->get('exception'));
 
       $response = $this->container->get('http_kernel')->handle($subrequest, HttpKernelInterface::SUB_REQUEST);
       $response->setStatusCode(404, 'Not Found');
diff --git a/core/modules/block/config/schema/block.schema.yml b/core/modules/block/config/schema/block.schema.yml
index 2e89fe7..530a69d 100644
--- a/core/modules/block/config/schema/block.schema.yml
+++ b/core/modules/block/config/schema/block.schema.yml
@@ -39,6 +39,9 @@ block.block.*:
             pages:
               type: string
               label: 'Show block on specific pages'
+            error_pages:
+              type: boolean
+              label: 'Show block on error pages'
         role:
           type: mapping
           label: 'Roles'
diff --git a/core/modules/block/lib/Drupal/block/BlockAccessController.php b/core/modules/block/lib/Drupal/block/BlockAccessController.php
index 4f5182b..37a0785 100644
--- a/core/modules/block/lib/Drupal/block/BlockAccessController.php
+++ b/core/modules/block/lib/Drupal/block/BlockAccessController.php
@@ -15,6 +15,7 @@
 use Drupal\Core\Path\AliasManagerInterface;
 use Drupal\Component\Utility\Unicode;
 use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
  * Provides a Block access controller.
@@ -29,16 +30,26 @@ class BlockAccessController extends EntityAccessController implements EntityCont
   protected $aliasManager;
 
   /**
+   * The request stack.
+   *
+   * @var \Symfony\Component\HttpFoundation\RequestStack
+   */
+  protected $requestStack;
+
+  /**
    * Constructs a BlockAccessController object.
    *
    * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
    *   The entity type definition.
    * @param \Drupal\Core\Path\AliasManagerInterface $alias_manager
    *   The alias manager.
+   * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
+   *   The request stack.
    */
-  public function __construct(EntityTypeInterface $entity_type, AliasManagerInterface $alias_manager) {
+  public function __construct(EntityTypeInterface $entity_type, AliasManagerInterface $alias_manager, RequestStack $request_stack) {
     parent::__construct($entity_type);
     $this->aliasManager = $alias_manager;
+    $this->requestStack = $request_stack;
   }
 
   /**
@@ -47,7 +58,8 @@ public function __construct(EntityTypeInterface $entity_type, AliasManagerInterf
   public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) {
     return new static(
       $entity_type,
-      $container->get('path.alias_manager')
+      $container->get('path.alias_manager'),
+      $container->get('request_stack')
     );
   }
 
@@ -81,6 +93,11 @@ protected function checkAccess(EntityInterface $entity, $operation, $langcode, A
       return FALSE;
     }
 
+    // Blocks can be configured to not appear on error pages.
+    if (isset($visibility['path']['error_pages']) && empty($visibility['path']['error_pages']) && $this->requestStack->getCurrentRequest()->attributes->has('exception')) {
+      return FALSE;
+    }
+
     // Page path handling.
     // Limited visibility blocks must list at least one page.
     if (!empty($visibility['path']['visibility']) && $visibility['path']['visibility'] == BLOCK_VISIBILITY_LISTED && empty($visibility['path']['pages'])) {
diff --git a/core/modules/block/lib/Drupal/block/BlockForm.php b/core/modules/block/lib/Drupal/block/BlockForm.php
index 350fde6..af432d2 100644
--- a/core/modules/block/lib/Drupal/block/BlockForm.php
+++ b/core/modules/block/lib/Drupal/block/BlockForm.php
@@ -163,6 +163,12 @@ public function form(array $form, array &$form_state) {
         '#description' => $description,
       );
     }
+    $form['visibility']['path']['error_pages'] = array(
+      '#type' => 'checkbox',
+      '#title' => $this->t('Show block on error pages'),
+      '#default_value' => isset($visibility['path']['error_pages']) ? $visibility['path']['error_pages'] : TRUE,
+      '#description' => $this->t('Whether blocks should appear on error pages like access denied or page not found.'),
+    );
 
     // Configure the block visibility per language.
     if ($this->languageManager->isMultilingual() && $this->languageManager instanceof ConfigurableLanguageManagerInterface) {
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
index 882863d..f74e43c 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
@@ -62,6 +62,30 @@ function testBlockVisibility() {
     // Confirm that an empty block is not displayed.
     $this->assertNoText('Powered by Drupal', 'Empty block not displayed.');
     $this->assertNoRaw('sidebar-first', 'Empty sidebar-first region is not displayed.');
+
+    // Check the block visibility on error pages.
+    $this->drupalLogin($this->adminUser);
+    $this->drupalGet('admin/structure/block/manage/invalid-id');
+    $this->assertResponse(404);
+    $this->assertText($title, 'Block was displayed on error page.');
+
+    // Hide the block on error pages.
+    $this->drupalPostForm('admin/structure/block/manage/' . $edit['id'], array('visibility[path][error_pages]' => FALSE), t('Save block'));
+    $this->drupalGet('admin/structure/block/manage/invalid-id');
+    $this->assertResponse(404);
+    $this->assertNoText($title, 'Block was not displayed on error page.');
+
+    // Use the test page as the 404 page.
+    \Drupal::config('system.site')->set('page.404', 'test-page')->save();
+    $this->drupalGet('admin/structure/block/manage/invalid-id');
+    $this->assertResponse(404);
+    $this->assertNoText($title, 'Block was not displayed on error page.');
+
+    // Show the block on error pages.
+    $this->drupalPostForm('admin/structure/block/manage/' . $edit['id'], array('visibility[path][error_pages]' => TRUE), t('Save block'));
+    $this->drupalGet('admin/structure/block/manage/invalid-id');
+    $this->assertResponse(404);
+    $this->assertText($title, 'Block was displayed on error page.');
   }
 
   /**
diff --git a/core/modules/help/lib/Drupal/help/Tests/HelpTest.php b/core/modules/help/lib/Drupal/help/Tests/HelpTest.php
index 58de88d..2651867 100644
--- a/core/modules/help/lib/Drupal/help/Tests/HelpTest.php
+++ b/core/modules/help/lib/Drupal/help/Tests/HelpTest.php
@@ -48,12 +48,27 @@ public function setUp() {
     $this->getModuleList();
 
     // Create users.
-    $this->adminUser = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer permissions'));
+    $this->adminUser = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer permissions', 'administer modules'));
     $this->anyUser = $this->drupalCreateUser(array());
   }
 
   /**
-   * Logs in users, creates dblog events, and tests dblog functionality.
+   * Tests help blocks on some admin page.
+   */
+  public function testHelpOnAdminPage() {
+    $this->drupalLogin($this->anyUser);
+    $this->drupalGet('admin/modules');
+    $result = $this->xpath('//div[contains(@class, "region-help")]');
+    $this->assertEqual(count($result), 0);
+
+    $this->drupalLogin($this->adminUser);
+    $this->drupalGet('admin/modules');
+    $result = $this->xpath('//div[contains(@class, "region-help")]');
+    $this->assertEqual(count($result), 1);
+  }
+
+  /**
+   * Tests the admin/help pages for all core modules.
    */
   public function testHelp() {
     // Login the admin user.
diff --git a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php
index 7105a30..c95b44c 100644
--- a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php
+++ b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php
@@ -91,11 +91,6 @@ public function access(AccountInterface $account) {
   protected function getActiveHelp(Request $request) {
     $output = '';
     $router_path = $request->attributes->get('_system_path');
-    // Do not show on a 403 or 404 page.
-    if ($request->attributes->has('exception')) {
-      return '';
-    }
-
     $arg = drupal_help_arg(explode('/', $router_path));
 
     foreach ($this->moduleHandler->getImplementations('help') as $module) {
diff --git a/core/profiles/standard/config/install/block.block.bartik_help.yml b/core/profiles/standard/config/install/block.block.bartik_help.yml
index 3e139c6..b41e0d1 100644
--- a/core/profiles/standard/config/install/block.block.bartik_help.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_help.yml
@@ -13,6 +13,7 @@ visibility:
   path:
     visibility: 0
     pages: ''
+    error_pages: false
   role:
     roles: {  }
   node_type:
diff --git a/core/profiles/standard/config/install/block.block.seven_help.yml b/core/profiles/standard/config/install/block.block.seven_help.yml
index f54a908..62133ea 100644
--- a/core/profiles/standard/config/install/block.block.seven_help.yml
+++ b/core/profiles/standard/config/install/block.block.seven_help.yml
@@ -13,6 +13,7 @@ visibility:
   path:
     visibility: 0
     pages: ''
+    error_pages: false
   role:
     roles: {  }
   node_type:
