 core/lib/Drupal/Core/Url.php                     | 6 +++++-
 core/tests/Drupal/Tests/Core/UnroutedUrlTest.php | 3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/core/lib/Drupal/Core/Url.php b/core/lib/Drupal/Core/Url.php
index f29e146..6a58319 100644
--- a/core/lib/Drupal/Core/Url.php
+++ b/core/lib/Drupal/Core/Url.php
@@ -272,7 +272,11 @@ public static function fromUri($uri, $options = []) {
     if ($uri_parts === FALSE) {
       throw new \InvalidArgumentException("The URI '$uri' is malformed.");
     }
-    if (empty($uri_parts['scheme'])) {
+    // We support protocol-relative URLs.
+    if (strpos($uri, '//') === 0) {
+      $uri_parts['scheme'] = '';
+    }
+    elseif (empty($uri_parts['scheme'])) {
       throw new \InvalidArgumentException("The URI '$uri' is invalid. You must use a valid URI scheme.");
     }
     $uri_parts += ['path' => ''];
diff --git a/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php b/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php
index 2674b36..ef6dd25 100644
--- a/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php
+++ b/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php
@@ -82,6 +82,8 @@ public function providerFromUri() {
       // [$uri, $is_external]
       // An external URI.
       ['https://www.drupal.org', TRUE],
+      // A protocol-relative URL.
+      ['//www.drupal.org', TRUE],
       // An internal, unrouted, base-relative URI.
       ['base:robots.txt', FALSE],
       // Base-relative URIs with special characters.
@@ -114,7 +116,6 @@ public function providerFromInvalidUri() {
       // Schemeless paths.
       ['test'],
       ['/test'],
-      ['//test'],
       // Schemeless path with a query string.
       ['foo?bar'],
       // Only a query string.
