diff --git a/core/lib/Drupal/Core/Routing/UrlGenerator.php b/core/lib/Drupal/Core/Routing/UrlGenerator.php
index 4657fdf..c838ffc 100644
--- a/core/lib/Drupal/Core/Routing/UrlGenerator.php
+++ b/core/lib/Drupal/Core/Routing/UrlGenerator.php
@@ -159,7 +159,6 @@ public function generate($name, $parameters = array(), $absolute = FALSE) {
    */
   public function generateFromRoute($name, $parameters = array(), $options = array()) {
     $options += array('prefix' => '');
-    $absolute = !empty($options['absolute']);
     $route = $this->getRoute($name);
     $this->processRoute($name, $route, $parameters);
 
@@ -170,6 +169,7 @@ public function generateFromRoute($name, $parameters = array(), $options = array
 
     $path = $this->getInternalPathFromRoute($route, $parameters);
     $path = $this->processPath($path, $options);
+
     if (!empty($options['prefix'])) {
       $path = ltrim($path, '/');
       $prefix = empty($path) ? rtrim($options['prefix'], '/') : $options['prefix'];
@@ -183,7 +183,26 @@ public function generateFromRoute($name, $parameters = array(), $options = array
       }
     }
 
-    $base_url = $this->context->getBaseUrl();
+    // The base_url might be rewritten from the language rewrite in domain mode.
+    if (isset($options['base_url'])) {
+      $base_url = $options['base_url'];
+
+      if (isset($options['https']) && $this->mixedModeSessions) {
+        if ($options['https'] === TRUE) {
+          $base_url = str_replace('http://', 'https://', $base_url);
+        }
+        elseif ($options['https'] === FALSE) {
+          $base_url = str_replace('https://', 'http://', $base_url);
+        }
+      }
+
+      return $base_url . $path . $fragment;
+    }
+    else {
+      $base_url = $this->context->getBaseUrl();
+    }
+
+    $absolute = !empty($options['absolute']);
     if (!$absolute || !$host = $this->context->getHost()) {
       return $base_url . $path . $fragment;
     }
diff --git a/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php b/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php
index e80e193..38b5a33 100644
--- a/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php
+++ b/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php
@@ -60,8 +60,8 @@
    *     defined, the current scheme is used, so the user stays on HTTP or HTTPS
    *     respectively. TRUE enforces HTTPS and FALSE enforces HTTP, but HTTPS can
    *     only be enforced when the variable 'https' is set to TRUE.
-   *   - 'base_url': Only used internally, to modify the base URL when a language
-   *     dependent URL requires so.
+   *   - 'base_url': Only used internally by a path processor, for example, to
+   *     modify the base URL when a language dependent URL requires so.
    *   - 'prefix': Only used internally, to modify the path when a language
    *     dependent URL requires so.
    *   - 'script': Added to the URL between the base path and the path prefix.
@@ -134,6 +134,8 @@ public function getPathFromRoute($name, $parameters = array());
    *     defined, the current scheme is used, so the user stays on HTTP or HTTPS
    *     respectively. if mixed mode sessions are permitted, TRUE enforces HTTPS
    *     and FALSE enforces HTTP.
+   *   - 'base_url': Only used internally by a path processor, for example, to
+   *     modify the base URL when a language dependent URL requires so.
    *   - 'prefix': Only used internally, to modify the path when a language
    *     dependent URL requires so.
    *
diff --git a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
index 7404372..3949a6d 100644
--- a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
@@ -259,6 +259,33 @@ public function testAbsoluteURLGeneration() {
   }
 
   /**
+   * Confirms that explicitly setting the base_url works with generated routes
+   */
+  public function testBaseURLGeneration() {
+    $options = array('base_url' => 'http://www.example.com:8888');
+    $url = $this->generator->generateFromRoute('test_1', array(), $options);
+    $this->assertEquals('http://www.example.com:8888/hello/world', $url);
+
+    $options = array('base_url' => 'http://www.example.com:8888', 'https' => TRUE);
+    // Mixed-mode sessions are not enabled, so the https option is ignored.
+    $url = $this->generator->generateFromRoute('test_1', array(), $options);
+    $this->assertEquals('http://www.example.com:8888/hello/world', $url);
+
+    // Mixed-mode sessions are enabled, so the https option is obeyed.
+    $url = $this->generatorMixedMode->generateFromRoute('test_1', array(), $options);
+    $this->assertEquals('https://www.example.com:8888/hello/world', $url);
+
+    $this->routeProcessorManager->expects($this->once())
+      ->method('processOutbound')
+      ->with($this->anything());
+
+    $options = array('base_url' => 'http://www.example.com:8888', 'fragment' => 'top');
+    // Extra parameters should appear in the query string.
+    $url = $this->generator->generateFromRoute('test_1', array('zoo' => '5'), $options);
+    $this->assertEquals('http://www.example.com:8888/hello/world?zoo=5#top', $url);
+  }
+
+  /**
    * Test that the 'scheme' route requirement is respected during url generation.
    */
   public function testUrlGenerationWithHttpsRequirement() {
