diff --git a/core/modules/views/tests/src/Kernel/ViewsPreprocessTest.php b/core/modules/views/tests/src/Kernel/ViewsPreprocessTest.php
index fb0d03ad4ddc1b27eb0973ce8d2bb5523ca8acd0..9b8a9ea5ff04dc908e09626898b3e540b970255a 100644
--- a/core/modules/views/tests/src/Kernel/ViewsPreprocessTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewsPreprocessTest.php
@@ -46,15 +46,15 @@ public function testCssClassCleaning() {
     $view = Views::getView('test_preprocess');
     $build = $view->buildRenderable();
     $renderer->renderRoot($build);
-    $this->assertStringContainsString('class="entity-test--default entity-test__default', (string) $build['#markup']);
+    $this->assertStringContainsString('class="entity-test__default', (string) $build['#markup']);
     $view->destroy();
 
     $view->setDisplay('display_2');
     $build = $view->buildRenderable();
     $renderer->renderRoot($build);
     $markup = (string) $build['#markup'];
-    $this->assertStringContainsString('css_class: entity-test--default and-another-class entity-test__default', $markup);
-    $this->assertStringContainsString('attributes: class="entity-test--default and-another-class entity-test__default', $markup);
+    $this->assertStringContainsString('css_class: entity-test__default and-another-class', $markup);
+    $this->assertStringContainsString('attributes: class="entity-test__default and-another-class', $markup);
   }
 
   /**
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc
index 58d34f16ae72c8ac2244dc1d2bdd695114dc937c..fe840b638cd121c20c625bf8c8a61ef366278bbd 100644
--- a/core/modules/views/views.theme.inc
+++ b/core/modules/views/views.theme.inc
@@ -35,17 +35,10 @@ function template_preprocess_views_view(&$variables) {
 
   $css_class = $view->display_handler->getOption('css_class');
   if (!empty($css_class)) {
-    // Views uses its own sanitization method. This is preserved to keep
-    // backwards compatibility.
-    // @todo https://www.drupal.org/project/drupal/issues/2977950 Decide what to
-    //   do with the backwards compatibility layer.
-    $bc_classes = explode(' ', preg_replace('/[^a-zA-Z0-9- ]/', '-', $css_class));
-    // Sanitize the classes using the classes using the proper API.
     $sanitized_classes = array_map('\Drupal\Component\Utility\Html::cleanCssIdentifier', explode(' ', $css_class));
-    $view_classes = array_unique(array_merge($bc_classes, $sanitized_classes));
     // Merge the view display classes into any existing classes if they exist.
-    $variables['attributes']['class'] = !empty($variables['attributes']['class']) ? array_merge($variables['attributes']['class'], $view_classes) : $view_classes;
-    $variables['css_class'] = implode(' ', $view_classes);
+    $variables['attributes']['class'] = !empty($variables['attributes']['class']) ? array_merge($variables['attributes']['class'], $sanitized_classes) : $sanitized_classes;
+    $variables['css_class'] = implode(' ', $sanitized_classes);
   }
 
   // contextual_preprocess() only works on render elements, and since this theme
diff --git a/core/themes/stable9/stable9.theme b/core/themes/stable9/stable9.theme
index d1b54033e0bef9956e598fc14cb558cee498cc6a..228e3ff0e95f6bfd865e1194de1c9df12edf112d 100644
--- a/core/themes/stable9/stable9.theme
+++ b/core/themes/stable9/stable9.theme
@@ -15,3 +15,20 @@ function stable9_preprocess_item_list__search_results(&$variables) {
     $variables['empty']['#tag'] = 'h3';
   }
 }
+
+/**
+ * Implements hook_preprocess_views_view().
+ *
+ * Adds BC classes that were previously added by the Views module.
+ */
+function stable9_preprocess_views_view(&$variables) {
+  if (!empty($variables['attributes']['class'])) {
+    $bc_classes = preg_replace('/[^a-zA-Z0-9- ]/', '-', $variables['attributes']['class']);
+    $variables['attributes']['class'] = array_merge($variables['attributes']['class'], $bc_classes);
+  }
+  if (!empty($variables['css_class'])) {
+    $existing_classes = explode(' ', $variables['css_class']);
+    $bc_classes = preg_replace('/[^a-zA-Z0-9- ]/', '-', $existing_classes);
+    $variables['css_class'] = implode(' ', array_merge($existing_classes, $bc_classes));
+  }
+}