diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php
index 170156c2d55c7f2c3b4eaba5cfc188a531f2e550..a0dab57b64513302ddb1bb079ac4985b71dd25bb 100644
--- a/lib/SimpleSAML/Utilities.php
+++ b/lib/SimpleSAML/Utilities.php
@@ -939,33 +939,10 @@ class SimpleSAML_Utilities {
 
 
 	/**
-	 * Parse a query string into an array.
-	 *
-	 * This function parses a query string into an array, similar to the way the builtin
-	 * 'parse_str' works, except it doesn't handle arrays, and it doesn't do "magic quotes".
-	 *
-	 * Query parameters without values will be set to an empty string.
-	 *
-	 * @param $query_string  The query string which should be parsed.
-	 * @return The query string as an associative array.
+	 * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::parseQueryString() instead.
 	 */
 	public static function parseQueryString($query_string) {
-		assert('is_string($query_string)');
-
-		$res = array();
-		foreach(explode('&', $query_string) as $param) {
-			$param = explode('=', $param);
-			$name = urldecode($param[0]);
-			if(count($param) === 1) {
-				$value = '';
-			} else {
-				$value = urldecode($param[1]);
-			}
-
-			$res[$name] = $value;
-		}
-
-		return $res;
+		return \SimpleSAML\Utils\HTTP::parseQueryString($query_string);
 	}
 
 
diff --git a/lib/SimpleSAML/Utils/HTTP.php b/lib/SimpleSAML/Utils/HTTP.php
index 01a6209fd3078c47b06b341a726f98a2dbea4a67..d501162af742f2a86f7cf4b7fe9b0e08cb019395 100644
--- a/lib/SimpleSAML/Utils/HTTP.php
+++ b/lib/SimpleSAML/Utils/HTTP.php
@@ -87,4 +87,40 @@ class HTTP
         }
         return $port;
     }
+
+
+    /**
+     * Parse a query string into an array.
+     *
+     * This function parses a query string into an array, similar to the way the builtin 'parse_str' works, except it
+     * doesn't handle arrays, and it doesn't do "magic quotes".
+     *
+     * Query parameters without values will be set to an empty string.
+     *
+     * @param string $query_string The query string which should be parsed.
+     *
+     * @return array The query string as an associative array.
+     * @throws \SimpleSAML_Error_Exception If $query_string is not a string.
+     *
+     * @author Olav Morken, UNINETT AS <olav.morken@uninett.no>
+     */
+    public static function parseQueryString($query_string)
+    {
+        if (!is_string($query_string)) {
+            throw new \SimpleSAML_Error_Exception('Invalid input parameters');
+        }
+
+        $res = array();
+        foreach (explode('&', $query_string) as $param) {
+            $param = explode('=', $param);
+            $name = urldecode($param[0]);
+            if (count($param) === 1) {
+                $value = '';
+            } else {
+                $value = urldecode($param[1]);
+            }
+            $res[$name] = $value;
+        }
+        return $res;
+    }
 }
\ No newline at end of file