diff --git a/core/lib/Drupal/Core/Config/Schema/Sequence.php b/core/lib/Drupal/Core/Config/Schema/Sequence.php
index e03427e..7b98761 100644
--- a/core/lib/Drupal/Core/Config/Schema/Sequence.php
+++ b/core/lib/Drupal/Core/Config/Schema/Sequence.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Core\Config\Schema;
 
+use Drupal\Core\TypedData\TypedDataInterface;
+
 /**
  * Defines a configuration element of type Sequence.
  *
@@ -16,6 +18,17 @@ class Sequence extends ArrayElement {
   /**
    * {@inheritdoc}
    */
+  public function __construct($definition, $name = NULL, TypedDataInterface $parent = NULL) {
+    parent::__construct($definition, $name, $parent);
+
+    if (!isset($this->definition['orderby'])) {
+      $this->definition['orderby'] = 'none';
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   protected function getElementDefinition($key) {
     $value = isset($this->value[$key]) ? $this->value[$key] : NULL;
     // @todo: Remove BC layer for sequence with hyphen in front. https://www.drupal.org/node/2444979
diff --git a/core/lib/Drupal/Core/Config/StorableConfigBase.php b/core/lib/Drupal/Core/Config/StorableConfigBase.php
index 40a25ef..d0c89e9 100644
--- a/core/lib/Drupal/Core/Config/StorableConfigBase.php
+++ b/core/lib/Drupal/Core/Config/StorableConfigBase.php
@@ -3,6 +3,7 @@
 namespace Drupal\Core\Config;
 
 use Drupal\Core\Config\Schema\Ignore;
+use Drupal\Core\Config\Schema\Sequence;
 use Drupal\Core\TypedData\PrimitiveInterface;
 use Drupal\Core\TypedData\Type\FloatInterface;
 use Drupal\Core\TypedData\Type\IntegerInterface;
@@ -210,6 +211,18 @@ protected function castValue($key, $value) {
       foreach ($value as $nested_value_key => $nested_value) {
         $value[$nested_value_key] = $this->castValue($key . '.' . $nested_value_key, $nested_value);
       }
+
+      if ($element instanceof Sequence) {
+        // Apply any sorting defined on the schema.
+        switch ($element->getDataDefinition()['orderby']) {
+          case 'key':
+            ksort($value);
+            break;
+          case 'value':
+            sort($value);
+            break;
+        }
+      }
     }
     return $value;
   }
diff --git a/core/modules/config/tests/config_schema_test/config/schema/config_schema_test.schema.yml b/core/modules/config/tests/config_schema_test/config/schema/config_schema_test.schema.yml
index c10e268..ce894c2 100644
--- a/core/modules/config/tests/config_schema_test/config/schema/config_schema_test.schema.yml
+++ b/core/modules/config/tests/config_schema_test/config/schema/config_schema_test.schema.yml
@@ -297,3 +297,41 @@ test.double_brackets.breed:
   mapping:
     breed:
       type: string
+
+config_schema_test.schema_sequence_sort:
+  type: config_object
+  mapping:
+    keyed_sort:
+      type: sequence
+      orderby: key
+      sequence:
+        - type: string
+    value_sort:
+      type: sequence
+      orderby: value
+      sequence:
+        - type: string
+    no_sort:
+      type: sequence
+      sequence:
+        - type: string
+    complex_sort_value:
+      type: sequence
+      orderby: value
+      sequence:
+        - type: mapping
+          mapping:
+            foo:
+              type: string
+            bar:
+              type: string
+    complex_sort_key:
+      type: sequence
+      orderby: key
+      sequence:
+        - type: mapping
+          mapping:
+            foo:
+              type: string
+            bar:
+              type: string
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
index 8a39d64..158854c 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
@@ -396,6 +396,76 @@ public function testConfigSaveWithSchema() {
   }
 
   /**
+   * Test configuration sequence sorting using schemas.
+   */
+  public function testConfigSaveWithSequenceSorting() {
+    $data = [
+      'keyed_sort' => [
+        'b' => '1',
+        'a' => '2',
+      ],
+      'no_sort' => [
+        'b' => '2',
+        'a' => '1',
+      ],
+    ];
+    // Save config which has a schema that enforces sorting.
+    $this->config('config_schema_test.schema_sequence_sort')
+      ->setData($data)
+      ->save();
+    $this->assertSame(['a' => '2', 'b' => '1'], $this->config('config_schema_test.schema_sequence_sort')->get('keyed_sort'));
+    $this->assertSame(['b' => '2', 'a' => '1'], $this->config('config_schema_test.schema_sequence_sort')->get('no_sort'));
+
+    $data = [
+      'value_sort' => ['b', 'a'],
+      'no_sort' => ['b', 'a'],
+    ];
+    // Save config which has a schema that enforces sorting.
+    $this->config('config_schema_test.schema_sequence_sort')
+      ->setData($data)
+      ->save();
+
+    $this->assertSame(['a', 'b'], $this->config('config_schema_test.schema_sequence_sort')->get('value_sort'));
+    $this->assertSame(['b', 'a'], $this->config('config_schema_test.schema_sequence_sort')->get('no_sort'));
+
+    // Value sort does not preserve keys - this is intentional.
+    $data = [
+      'value_sort' => [1 => 'b', 2 => 'a'],
+      'no_sort' => [1 => 'b', 2 => 'a'],
+    ];
+    // Save config which has a schema that enforces sorting.
+    $this->config('config_schema_test.schema_sequence_sort')
+      ->setData($data)
+      ->save();
+
+    $this->assertSame(['a', 'b'], $this->config('config_schema_test.schema_sequence_sort')->get('value_sort'));
+    $this->assertSame([1 => 'b', 2 => 'a'], $this->config('config_schema_test.schema_sequence_sort')->get('no_sort'));
+
+    // Tests sorts do never destroy complex values.
+    $data = [
+      'complex_sort_value' => [['foo' => 'b', 'bar' => 'b'] , ['foo' => 'a', 'bar' => 'a']],
+      'complex_sort_key' => ['b' => ['foo' => '1', 'bar' => '1'] , 'a' => ['foo' => '2', 'bar' => '2']],
+    ];
+    $this->config('config_schema_test.schema_sequence_sort')
+      ->setData($data)
+      ->save();
+    $this->assertSame([['foo' => 'a', 'bar' => 'a'], ['foo' => 'b', 'bar' => 'b']], $this->config('config_schema_test.schema_sequence_sort')->get('complex_sort_value'));
+    $this->assertSame(['a' => ['foo' => '2', 'bar' => '2'], 'b' => ['foo' => '1', 'bar' => '1']], $this->config('config_schema_test.schema_sequence_sort')->get('complex_sort_key'));
+
+    // Swap the previous test scenario around.
+    $data = [
+      'complex_sort_value' => ['b' => ['foo' => '1', 'bar' => '1'] , 'a' => ['foo' => '2', 'bar' => '2']],
+      'complex_sort_key' => [['foo' => 'b', 'bar' => 'b'] , ['foo' => 'a', 'bar' => 'a']],
+    ];
+    $this->config('config_schema_test.schema_sequence_sort')
+      ->setData($data)
+      ->save();
+    $this->assertSame([['foo' => '1', 'bar' => '1'], ['foo' => '2', 'bar' => '2']], $this->config('config_schema_test.schema_sequence_sort')->get('complex_sort_value'));
+    $this->assertSame([['foo' => 'b', 'bar' => 'b'], ['foo' => 'a', 'bar' => 'a']], $this->config('config_schema_test.schema_sequence_sort')->get('complex_sort_key'));
+
+  }
+
+  /**
    * Tests fallback to a greedy wildcard.
    */
   function testSchemaFallback() {
