diff --git a/core/lib/Drupal/Core/Command/GenerateProxyClassCommand.php b/core/lib/Drupal/Core/Command/GenerateProxyClassCommand.php
index 4fbe3e30f03784ca2c115f06dc7de43948140909..288deaa4861c073fbbb4c78c2e5042ca1e4b6d67 100644
--- a/core/lib/Drupal/Core/Command/GenerateProxyClassCommand.php
+++ b/core/lib/Drupal/Core/Command/GenerateProxyClassCommand.php
@@ -56,7 +56,7 @@ protected function configure() {
    * {@inheritdoc}
    */
   protected function execute(InputInterface $input, OutputInterface $output) {
-    $class_name = $input->getArgument('class_name');
+    $class_name = ltrim($input->getArgument('class_name'), '\\');
     $namespace_root = $input->getArgument('namespace_root_path');
 
     $match = [];
@@ -76,7 +76,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
 
 /**
  * @file
- * Contains {{ proxy_class_name }}.
+ * Contains \{{ proxy_class_name }}.
  */
 
 /**