diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index d94ec3b..4ef319a 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -465,6 +465,10 @@ function block_list($region) {
     $blocks[$region] = array();
   }
 
+  uasort($blocks[$region], function($first, $second) {
+    return $first->weight < $second->weight ? ($first->weight === $second->weight ? 0 : -1) : 1;
+  });
+
   return $blocks[$region];
 }
 
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockRenderOrderTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockRenderOrderTest.php
new file mode 100644
index 0000000..80a0c22
--- /dev/null
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockRenderOrderTest.php
@@ -0,0 +1,63 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\block\Tests\BlockRenderOrderTest.
+ */
+
+namespace Drupal\block\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests block HTML ID validity.
+ */
+class BlockRenderOrderTest extends WebTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('block', 'block_test', 'search');
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Block Render Order',
+      'description' => 'Tests block Render Order validity.',
+      'group' => 'Block',
+    );
+  }
+
+  function setUp() {
+    parent::setUp();
+    // Create an admin user.
+    $end_user = $this->drupalCreateUser(array(
+      'access content',
+      'search content',
+    ));
+    $this->drupalLogin($end_user);
+  }
+
+  /**
+   * Tests the render order of the blocks.
+   */
+  function testBlockRenderOrder() {
+    //Enable test blocks and place them in the same region.
+    $blocks = array(array($this->randomName(8), 'system_powered_by_block'), array($this->randomName(8), 'search_form_block'));
+    foreach ($blocks as $weight => $settings) {
+      $this->drupalPlaceBlock($settings[1], array(
+        'label' => $settings[0],
+        'weight' => $weight,
+        'region' => 'header',
+      ));
+    }
+    $this->drupalGet('');
+    $test_content = $this->drupalGetContent('');
+    foreach ($blocks as $weight => $settings) {
+      $this->assertRaw('<h2>' . $settings[0] . '</h2>', 'Block "' . $settings[0]  . '" is in place.');
+      $position[$weight] = strpos($test_content, $settings[0]);
+    }
+    $this->assertTrue($position[0] < $position[1], 'The blocks are rendered in the correct order.');
+  }
+}
