diff --git a/composer.lock b/composer.lock
index 1a9b87e9d7cd359157d6bb0c1038329bbec5871d..3475ec69e5287d3c6617949f08a5eda5fc434db3 100644
--- a/composer.lock
+++ b/composer.lock
@@ -496,7 +496,7 @@
             "dist": {
                 "type": "path",
                 "url": "core",
-                "reference": "f9821a77ceb47977e9db1cf4cb3364e47f74a66d"
+                "reference": "f8027006bc6ac7d9ff990897dc7a2c7f4db5b67a"
             },
             "require": {
                 "asm89/stack-cors": "^2.1",
@@ -543,7 +543,7 @@
                 "symfony/serializer": "^7.1",
                 "symfony/validator": "^7.1",
                 "symfony/yaml": "^7.1",
-                "twig/twig": "^3.9.3"
+                "twig/twig": "^3.11.0"
             },
             "conflict": {
                 "drush/drush": "<12.4.3"
@@ -4266,16 +4266,16 @@
         },
         {
             "name": "twig/twig",
-            "version": "v3.10.3",
+            "version": "v3.11.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/twigphp/Twig.git",
-                "reference": "67f29781ffafa520b0bbfbd8384674b42db04572"
+                "reference": "e80fb8ebba85c7341a97a9ebf825d7fd4b77708d"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/twigphp/Twig/zipball/67f29781ffafa520b0bbfbd8384674b42db04572",
-                "reference": "67f29781ffafa520b0bbfbd8384674b42db04572",
+                "url": "https://api.github.com/repos/twigphp/Twig/zipball/e80fb8ebba85c7341a97a9ebf825d7fd4b77708d",
+                "reference": "e80fb8ebba85c7341a97a9ebf825d7fd4b77708d",
                 "shasum": ""
             },
             "require": {
@@ -4283,7 +4283,8 @@
                 "symfony/deprecation-contracts": "^2.5|^3",
                 "symfony/polyfill-ctype": "^1.8",
                 "symfony/polyfill-mbstring": "^1.3",
-                "symfony/polyfill-php80": "^1.22"
+                "symfony/polyfill-php80": "^1.22",
+                "symfony/polyfill-php81": "^1.29"
             },
             "require-dev": {
                 "psr/container": "^1.0|^2.0",
@@ -4329,7 +4330,7 @@
             ],
             "support": {
                 "issues": "https://github.com/twigphp/Twig/issues",
-                "source": "https://github.com/twigphp/Twig/tree/v3.10.3"
+                "source": "https://github.com/twigphp/Twig/tree/v3.11.0"
             },
             "funding": [
                 {
@@ -4341,7 +4342,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2024-05-16T10:04:27+00:00"
+            "time": "2024-08-08T16:15:16+00:00"
         }
     ],
     "packages-dev": [
diff --git a/composer/Metapackage/CoreRecommended/composer.json b/composer/Metapackage/CoreRecommended/composer.json
index 746a52004e6e8d0a01b1e28e3ee124a451a417fe..10c08172af0d635f0fa126daac3e605eb953eeaf 100644
--- a/composer/Metapackage/CoreRecommended/composer.json
+++ b/composer/Metapackage/CoreRecommended/composer.json
@@ -60,6 +60,6 @@
         "symfony/var-dumper": "~v7.1.3",
         "symfony/var-exporter": "~v7.1.2",
         "symfony/yaml": "~v7.1.1",
-        "twig/twig": "~v3.10.3"
+        "twig/twig": "~v3.11.0"
     }
 }
diff --git a/core/.deprecation-ignore.txt b/core/.deprecation-ignore.txt
index ec42944605b3e2778bd2c50b4201068edebac09b..421433ea1ebd9be08a7df98a2cefee8e90c3909c 100644
--- a/core/.deprecation-ignore.txt
+++ b/core/.deprecation-ignore.txt
@@ -26,3 +26,6 @@
 
 # PHPUnit 10.
 %The "PHPUnit\\Framework\\TestCase::__construct\(\)" method is considered internal.*You should not extend it from "Drupal\\[^"]+"%
+
+# Twig 3.11.0
+%Since twig/twig 3.11: Changing the value of a "filter" node in a NodeVisitor class is not supported anymore.%
diff --git a/core/composer.json b/core/composer.json
index ec0bc7a058453087e73d9c952ecc0a2948dd4050..19c97f26b13ddc4b1772753742eba846d774201f 100644
--- a/core/composer.json
+++ b/core/composer.json
@@ -34,7 +34,7 @@
         "symfony/process": "^7.1",
         "symfony/polyfill-iconv": "^1.26",
         "symfony/yaml": "^7.1",
-        "twig/twig": "^3.9.3",
+        "twig/twig": "^3.11.0",
         "doctrine/annotations": "^2.0",
         "doctrine/lexer": "^2.0",
         "guzzlehttp/guzzle": "^7.5",
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php b/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php
index 1552dc39a0135f79a39ad879dc827c7b26e787e3..7f24496f24f5a784e1d4ac87376161cae6af2ec6 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php
@@ -12,7 +12,6 @@
 use Drupal\Core\Template\TwigPhpStorageCache;
 use Drupal\KernelTests\KernelTestBase;
 use Symfony\Component\DependencyInjection\Definition;
-use Twig\Environment;
 use Twig\Error\LoaderError;
 
 /**
@@ -218,17 +217,6 @@ public function testTemplateInvalidation(): void {
     file_put_contents($template_file, $template_after);
     $output = $environment->load(basename($template_file))->render();
     $this->assertEquals($template_before, $output);
-
-    $environment->invalidate();
-    // Manually change $templateClassPrefix to force a different template
-    // classname, as the other class is still loaded. This wouldn't be a problem
-    // on a real site where you reload the page.
-    $reflection = new \ReflectionClass(Environment::class);
-    $property_reflection = $reflection->getProperty('templateClassPrefix');
-    $property_reflection->setValue($environment, 'otherPrefix');
-
-    $output = $environment->load(basename($template_file))->render();
-    $this->assertEquals($template_after, $output);
   }
 
   /**