diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index e1bc631..94c0304 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -513,7 +513,10 @@ function template_preprocess_block(&$variables) {
   $variables['content'] = $variables['elements']['content'];
 
   $variables['attributes']['class'][] = 'block';
-  $variables['attributes']['class'][] = drupal_html_class('block-' . $variables['configuration']['module']);
+  $variables['attributes']['class'][] = drupal_html_class($variables['configuration']['module']);
+  $plugin_id_class = str_replace(':', '--', $variables['plugin_id']);
+  $variables['attributes']['class'][] = drupal_html_class($plugin_id_class);
+  $variables['attributes']['id'] = drupal_html_id('block-' . $variables['elements']['#block']->id());
 
   // The block template provides a wrapping element for the content. Render the
   // #attributes of the content on this wrapping element rather than passing
@@ -527,11 +530,6 @@ function template_preprocess_block(&$variables) {
 
   // Add default class for block content.
   $variables['content_attributes']['class'][] = 'content';
-
-  // Create a valid HTML ID and make sure it is unique.
-  if ($id = $variables['elements']['#block']->id()) {
-    $variables['attributes']['id'] = drupal_html_id('block-' . $id);
-  }
 }
 
 /**
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockHtmlIdTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockHtmlIdTest.php
index de18e91..ab185a9 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockHtmlIdTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockHtmlIdTest.php
@@ -49,7 +49,7 @@ function setUp() {
   function testHtmlId() {
     $this->drupalGet('');
     $this->assertRaw('id="block-test-id-block"', 'HTML ID for test block is valid.');
-    $elements = $this->xpath('//div[contains(@class, :div-class)]/div/ul[contains(@class, :ul-class)]/li', array(':div-class' => 'block-system', ':ul-class' => 'menu'));
+    $elements = $this->xpath('//div[contains(@class, :div-class)]/div/ul[contains(@class, :ul-class)]/li', array(':div-class' => 'system-menu-blocktools', ':ul-class' => 'menu'));
     $this->assertTrue(!empty($elements), 'The proper block markup was found.');
   }
 
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php
index 82827ab..2bc047d 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php
@@ -134,7 +134,7 @@ protected function renderTests() {
     $entity = entity_load('block', 'test_block');
     $output = entity_view($entity, 'block');
     $expected = array();
-    $expected[] = '<div class="block block-block-test" id="block-test-block">';
+    $expected[] = '<div class="block block-test test-html-id" id="block-test-block">';
     $expected[] = '  ';
     $expected[] = '    ';
     $expected[] = '';
@@ -161,7 +161,7 @@ protected function renderTests() {
     $entity->save();
     $output = entity_view($entity, 'block');
     $expected = array();
-    $expected[] = '<div class="block block-block-test" id="block-test-block2">';
+    $expected[] = '<div class="block block-test test-html-id" id="block-test-block2">';
     $expected[] = '  ';
     $expected[] = '      <h2>Powered by Bananas</h2>';
     $expected[] = '    ';
