diff --git a/core/includes/database.inc b/core/includes/database.inc
index 6d5318b..5cfacd4 100644
--- a/core/includes/database.inc
+++ b/core/includes/database.inc
@@ -321,6 +321,8 @@ function db_query_range($query, $from, $count, array $args = array(), array $opt
  *   The name of the temporary table.
  *
  * @see \Drupal\Core\Database\Connection::defaultOptions()
+ *
+ * @deprecated in Drupal 8.0.x, will be removed before 8.1.0.
  */
 function db_query_temporary($query, array $args = array(), array $options = array()) {
   if (empty($options['target'])) {
diff --git a/core/lib/Drupal/Core/Database/Query/Select.php b/core/lib/Drupal/Core/Database/Query/Select.php
index 3c687da..7b7b1ef 100644
--- a/core/lib/Drupal/Core/Database/Query/Select.php
+++ b/core/lib/Drupal/Core/Database/Query/Select.php
@@ -572,6 +572,20 @@ public function execute() {
   /**
    * {@inheritdoc}
    */
+  public function executeTemporary() {
+    // If validation fails, simply return NULL.
+    // Note that validation routines in preExecute() may throw exceptions instead.
+    if (!$this->preExecute()) {
+      return NULL;
+    }
+
+    $args = $this->getArguments();
+    return $this->connection->queryTemporary((string) $this, $args, $this->queryOptions);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function distinct($distinct = TRUE) {
     $this->distinct = $distinct;
     return $this;
diff --git a/core/lib/Drupal/Core/Database/Query/SelectExtender.php b/core/lib/Drupal/Core/Database/Query/SelectExtender.php
index 9a378d2..60eeef3 100644
--- a/core/lib/Drupal/Core/Database/Query/SelectExtender.php
+++ b/core/lib/Drupal/Core/Database/Query/SelectExtender.php
@@ -188,6 +188,9 @@ public function preExecute(SelectInterface $query = NULL) {
     return $this->query->preExecute($query);
   }
 
+  /**
+   * {@inheritdoc}
+   */
   public function execute() {
     // By calling preExecute() here, we force it to preprocess the extender
     // object rather than just the base query object.  That means
@@ -199,6 +202,16 @@ public function execute() {
     return $this->query->execute();
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function executeTemporary() {
+    return $this->query->executeTemporary();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function distinct($distinct = TRUE) {
     $this->query->distinct($distinct);
     return $this;
diff --git a/core/lib/Drupal/Core/Database/Query/SelectInterface.php b/core/lib/Drupal/Core/Database/Query/SelectInterface.php
index b784610..2847fe3 100644
--- a/core/lib/Drupal/Core/Database/Query/SelectInterface.php
+++ b/core/lib/Drupal/Core/Database/Query/SelectInterface.php
@@ -489,6 +489,14 @@ public function preExecute(SelectInterface $query = NULL);
   public function execute();
 
   /**
+   * Executes a SELECT query string and saves the result set to a temporary table.
+   *
+   * @return string
+   *   The name of the temporary table.
+   */
+  public function executeTemporary();
+
+  /**
    * Helper function to build most common HAVING conditional clauses.
    *
    * This method can take a variable number of parameters. If called with two
diff --git a/core/modules/system/src/Tests/Database/SelectTest.php b/core/modules/system/src/Tests/Database/SelectTest.php
index 26dd109..b3df925 100644
--- a/core/modules/system/src/Tests/Database/SelectTest.php
+++ b/core/modules/system/src/Tests/Database/SelectTest.php
@@ -494,4 +494,22 @@ function testEmptyInCondition() {
     }
   }
 
+  /**
+   * Tests Select::executeTemporary().
+   */
+  function testExecuteTemporary() {
+    $query = db_select('test');
+    $query->addField('test', 'name');
+    $query->addField('test', 'age', 'age');
+    $temporary_table = $query->executeTemporary();
+    $this->assertTrue($temporary_table, 'Temporary table name returned.');
+
+    $query = db_select($temporary_table);
+    $query->addField($temporary_table, 'name');
+    $query->addField($temporary_table, 'age');
+
+    $num_records = $query->countQuery()->execute()->fetchField();
+    $this->assertEqual($num_records, 4, 'Returned the correct number of rows.');
+  }
+
 }
diff --git a/core/modules/system/src/Tests/Database/TemporaryQueryTest.php b/core/modules/system/src/Tests/Database/TemporaryQueryTest.php
index a3ac731..fdec4d1 100644
--- a/core/modules/system/src/Tests/Database/TemporaryQueryTest.php
+++ b/core/modules/system/src/Tests/Database/TemporaryQueryTest.php
@@ -42,20 +42,16 @@ function testTemporaryQuery() {
       $this->fail('The creation of the temporary table failed.');
     }
 
-    // Now try to run two db_query_temporary() in the same request.
-    $table_name_test = db_query_temporary('SELECT name FROM {test}', array());
-    $table_name_task = db_query_temporary('SELECT pid FROM {test_task}', array());
+    // Now try to run two temporary table queries in the same request.
+    $query = db_select('test');
+    $query->addField('test', 'name');
+    $table_name_test = $query->executeTemporary();
+    $query = db_select('test_task');
+    $query->addField('test_task', 'pid');
+    $table_name_task = $query->executeTemporary();
 
     $this->assertEqual($this->countTableRows($table_name_test), $this->countTableRows('test'), 'A temporary table was created successfully in this request.');
     $this->assertEqual($this->countTableRows($table_name_task), $this->countTableRows('test_task'), 'A second temporary table was created successfully in this request.');
-
-    // Check that leading whitespace and comments do not cause problems
-    // in the modified query.
-    $sql = "
-      -- Let's select some rows into a temporary table
-      SELECT name FROM {test}
-    ";
-    $table_name_test = db_query_temporary($sql, array());
-    $this->assertEqual($this->countTableRows($table_name_test), $this->countTableRows('test'), 'Leading white space and comments do not interfere with temporary table creation.');
   }
+
 }
diff --git a/core/modules/system/tests/modules/database_test/database_test.module b/core/modules/system/tests/modules/database_test/database_test.module
index 685a7d7..d5b5fef 100644
--- a/core/modules/system/tests/modules/database_test/database_test.module
+++ b/core/modules/system/tests/modules/database_test/database_test.module
@@ -54,7 +54,9 @@ function database_test_query_database_test_alter_remove_range_alter(AlterableInt
  * @deprecated \Drupal\database_test\Controller\DatabaseTestController::dbQueryTemporary()
  */
 function database_test_db_query_temporary() {
-  $table_name = db_query_temporary('SELECT age FROM {test}', array());
+  $query = db_select('test');
+  $query->addField('test', 'age');
+  $table_name = $query->executeTemporary();
   return new JsonResponse(array(
     'table_name' => $table_name,
     'row_count' => db_select($table_name)->countQuery()->execute()->fetchField(),
