diff --git a/core/includes/common.inc b/core/includes/common.inc
index 90641b6..72c1828 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -1881,7 +1881,7 @@ function drupal_delete_file_if_stale($uri) {
  * @return
  *   The cleaned identifier.
  */
-function drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '__' => '__', '/' => '-', '[' => '-', ']' => '')) {
+function drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '__' => '__', '/' => '-', '[' => '-', ']' => '', ':' => '--')) {
   // By default, we filter using Drupal's coding standards.
   $identifier = strtr($identifier, $filter);
 
diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index e1bc631..deab439 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -513,7 +513,8 @@ 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['plugin_id']);
+  $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 +528,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..15f98f2 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-block--tools', ':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[] = '    ';
diff --git a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php
index 4a1e64d..90b6042 100644
--- a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php
@@ -67,7 +67,7 @@ public function testBlockCategory() {
     // base table.
     $arguments = array(
       ':id' => 'edit-category-lists-views',
-      ':li_class' => 'views-block' . drupal_html_class($edit['id']) . '-block-1',
+      ':li_class' => 'views-block--' . drupal_html_class($edit['id']) . '-block-1',
       ':href' => url('admin/structure/block/add/views_block:' . $edit['id'] . '-block_1/stark'),
       ':text' => $edit['label'],
     );
@@ -103,7 +103,7 @@ public function testBlockCategory() {
 
     $arguments = array(
       ':id' => 'edit-category-lists-views',
-      ':li_class' => 'views-block' . drupal_html_class($edit['id']) . '-block-2',
+      ':li_class' => 'views-block--' . drupal_html_class($edit['id']) . '-block-2',
       ':href' => url('admin/structure/block/add/views_block:' . $edit['id'] . '-block_2/stark'),
       ':text' => $edit['label'],
     );
@@ -112,7 +112,7 @@ public function testBlockCategory() {
 
     $arguments = array(
       ':id' => $category_id,
-      ':li_class' => 'views-block' . drupal_html_class($edit['id']) . '-block-3',
+      ':li_class' => 'views-block--' . drupal_html_class($edit['id']) . '-block-3',
       ':href' => url('admin/structure/block/add/views_block:' . $edit['id'] . '-block_3/stark'),
       ':text' => $edit['label'],
     );
