diff --git a/core/modules/taxonomy/src/Form/OverviewTerms.php b/core/modules/taxonomy/src/Form/OverviewTerms.php
index 4c8cee3..4f536de 100644
--- a/core/modules/taxonomy/src/Form/OverviewTerms.php
+++ b/core/modules/taxonomy/src/Form/OverviewTerms.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\taxonomy\Form;
 
+use Drupal\Component\Utility\SortArray;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Extension\ModuleHandlerInterface;
@@ -377,8 +378,25 @@ public function buildForm(array $form, FormStateInterface $form_state, Vocabular
    *   The current state of the form.
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
-    // Sort term order based on weight.
-    uasort($form_state->getValue('terms'), array('Drupal\Component\Utility\SortArray', 'sortByWeightElement'));
+    // Mark each term with the current order in which they are displayed in the
+    // form.
+    $current_order = 0;
+    $values = $form_state->getValues('terms');
+    foreach ($values['terms'] as $tid => &$value) {
+      if (isset($form[$tid]['#term'])) {
+        $value->setValue('current_order', $current_order++);
+      }
+    }
+
+    // Sort terms, first on weight, second on the current order.
+    uasort($values['terms'], function ($a, $b) {
+      // If the terms have different weights, sort by weight.
+      if ($result = SortArray::sortByWeightElement((array) $a, (array) $b)) {
+        return $result;
+      }
+      // If the weights are identical, sort by the current order.
+      return SortArray::sortByKeyInt($a, $b, 'current_order');
+    });
 
     $vocabulary = $form_state->get(['taxonomy', 'vocabulary']);
     // Update the current hierarchy type as we go.
@@ -410,7 +428,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
       if (isset($form['terms'][$tid]['#term'])) {
         $term = $form['terms'][$tid]['#term'];
         // Give terms at the root level a weight in sequence with terms on previous pages.
-        if ($values['term']['parent'] == 0 && $term->getWeight() != $weight) {
+        if ($values['term']['parent'] == 0 && $values['weight'] != $weight) {
           $term->setWeight($weight);
           $changed_terms[$term->id()] = $term;
         }
diff --git a/core/modules/taxonomy/src/Tests/TermTest.php b/core/modules/taxonomy/src/Tests/TermTest.php
index 403c28c..59ad24a 100644
--- a/core/modules/taxonomy/src/Tests/TermTest.php
+++ b/core/modules/taxonomy/src/Tests/TermTest.php
@@ -416,9 +416,9 @@ function testTermReorder() {
 
     $taxonomy_storage->resetCache();
     $terms = $taxonomy_storage->loadTree($this->vocabulary->id());
-    $this->assertEqual($terms[0]->tid, $term2->id(), 'Term 2 was moved above term 1.');
-    $this->assertEqual($terms[1]->parents, array($term2->id()), 'Term 3 was made a child of term 2.');
-    $this->assertEqual($terms[2]->tid, $term1->id(), 'Term 1 was moved below term 2.');
+    $this->assertEqual($terms[0]->tid, $term1->id(), 'Term 1 was moved above term 2.');
+    $this->assertEqual($terms[1]->tid, $term2->id(), 'Term 2 was moved below term 1.');
+    $this->assertEqual($terms[2]->parents, array($term2->id()), 'Term 3 was made a child of term 2.');
 
     $this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/overview', array(), t('Reset to alphabetical'));
     // Submit confirmation form.
@@ -432,6 +432,12 @@ function testTermReorder() {
     $this->assertEqual($terms[1]->id(), $term2->id(), 'Term 2 was moved to back below term 1.');
     $this->assertEqual($terms[2]->id(), $term3->id(), 'Term 3 is still below term 2.');
     $this->assertEqual($terms[2]->parents, array($term2->id()), 'Term 3 is still a child of term 2.');
+
+    // Re-arrange the terms again.
+    $this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/overview', [], t('Save'));
+    $taxonomy_storage->resetCache();
+    $terms = $taxonomy_storage->loadTree($this->vocabulary->id());
+    $this->assertEqual($terms[0]->tid, $term1->id(), 'Term 1 is still above term 2.');
   }
 
   /**
