diff --git a/core/lib/Drupal/Core/Url.php b/core/lib/Drupal/Core/Url.php
index 76dc46c77b..fe811ac893 100644
--- a/core/lib/Drupal/Core/Url.php
+++ b/core/lib/Drupal/Core/Url.php
@@ -277,6 +277,10 @@ public static function fromUri($uri, $options = []) {
     if (strpos($uri, '//') === 0) {
       $uri_parts['scheme'] = '';
     }
+    // We support root-relative URLs.
+    elseif (strpos($uri, '/') === 0) {
+      $uri_parts['scheme'] = 'base';
+    }
     elseif (empty($uri_parts['scheme'])) {
       throw new \InvalidArgumentException("The URI '$uri' is invalid. You must use a valid URI scheme.");
     }
diff --git a/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php b/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php
index 680e2fde18..eb8c5e1d3c 100644
--- a/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php
+++ b/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php
@@ -84,6 +84,8 @@ public function providerFromUri() {
       ['https://www.drupal.org', TRUE],
       // A protocol-relative URL.
       ['//www.drupal.org', TRUE],
+      // A root-relative URL.
+      ['/robots.txt', FALSE],
       // An internal, unrouted, base-relative URI.
       ['base:robots.txt', FALSE],
       // Base-relative URIs with special characters.
@@ -115,7 +117,6 @@ public function providerFromInvalidUri() {
     return [
       // Schemeless paths.
       ['test'],
-      ['/test'],
       // Schemeless path with a query string.
       ['foo?bar'],
       // Only a query string.
diff --git a/core/tests/Drupal/Tests/Core/UrlTest.php b/core/tests/Drupal/Tests/Core/UrlTest.php
index ff4cb01b8b..13ad7fcfa4 100644
--- a/core/tests/Drupal/Tests/Core/UrlTest.php
+++ b/core/tests/Drupal/Tests/Core/UrlTest.php
@@ -345,6 +345,18 @@ public function testGetUriForProtocolRelativeUrl() {
     $this->assertTrue($url->isExternal());
   }
 
+  /**
+   * Tests the getUri() method for root-relative URLs.
+   *
+   * @covers ::getUri
+   * @covers ::isExternal
+   */
+  public function testGetUriForRootRelativeUrl() {
+    $url = Url::fromUri('/example/test');
+    $this->assertEquals('/example/test', $url->getUri());
+    $this->assertFalse($url->isExternal());
+  }
+
   /**
    * Tests the getInternalPath method().
    *
