diff --git a/core/includes/form.inc b/core/includes/form.inc
index a3d17a7..5e09e71 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -204,7 +204,14 @@ function template_preprocess_fieldset(&$variables) {
   }
 
   $variables['legend']['attributes'] = new Attribute();
-  $variables['legend_span']['attributes'] = new Attribute();
+
+  // Add 'visually-hidden' class to legend span.
+  if ($element['#title_display'] == 'invisible') {
+    $variables['legend_span']['attributes'] = new Attribute(array('class' => 'visually-hidden'));
+  }
+  else {
+    $variables['legend_span']['attributes'] = new Attribute();
+  }
 
   if (!empty($element['#description'])) {
     $description_id = $element['#attributes']['id'] . '--description';
diff --git a/core/modules/system/src/Tests/Installer/InstallerTest.php b/core/modules/system/src/Tests/Installer/InstallerTest.php
index debb891..d67c195 100644
--- a/core/modules/system/src/Tests/Installer/InstallerTest.php
+++ b/core/modules/system/src/Tests/Installer/InstallerTest.php
@@ -53,7 +53,8 @@ protected function setUpLanguage() {
   protected function setUpProfile() {
     // Assert that the expected title is present.
     $this->assertEqual('Select an installation profile', $this->cssSelect('main h1')[0]);
-
+    $result = $this->xpath('//span[contains(@class, :class) and contains(text(), :text)]', array(':class' => 'visually-hidden', ':text' => 'Select an installation profile'));
+    $this->assertEqual(count($result), 1, "Title/Label not displayed when '#title_display' => 'invisible' attribute is set");
     parent::setUpProfile();
   }
 
