diff --git a/changelog.d/13537.bugfix b/changelog.d/13537.bugfix
new file mode 100644
index 0000000000000000000000000000000000000000..db843504b10b013c36df45c799753332680df9aa
--- /dev/null
+++ b/changelog.d/13537.bugfix
@@ -0,0 +1 @@
+Add support for compression to federation responses.
diff --git a/docs/usage/configuration/config_documentation.md b/docs/usage/configuration/config_documentation.md
index aa175a0d91c9995ce3758618cb8cf78191a9b9aa..cc7296682320058f1266151ea1133be97ddb0c87 100644
--- a/docs/usage/configuration/config_documentation.md
+++ b/docs/usage/configuration/config_documentation.md
@@ -444,7 +444,7 @@ Sub-options for each listener include:
    * `names`: a list of names of HTTP resources. See below for a list of valid resource names.
 
    * `compress`: set to true to enable gzip compression on HTTP bodies for this resource. This is currently only supported with the
-     `client`, `consent` and `metrics` resources.
+     `client`, `consent`, `metrics` and `federation` resources.
 
 * `additional_resources`: Only valid for an 'http' listener. A map of
    additional endpoints which should be loaded via dynamic modules.
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index 745e7041414f8abdd2172791305c7155a4be41c6..d98012adebda2bbd171c6dd908fdff524b1acaaa 100644
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -220,7 +220,10 @@ class SynapseHomeServer(HomeServer):
             resources.update({"/_matrix/consent": consent_resource})
 
         if name == "federation":
-            resources.update({FEDERATION_PREFIX: TransportLayerServer(self)})
+            federation_resource: Resource = TransportLayerServer(self)
+            if compress:
+                federation_resource = gz_wrap(federation_resource)
+            resources.update({FEDERATION_PREFIX: federation_resource})
 
         if name == "openid":
             resources.update(