diff --git a/django/test/testcases.py b/django/test/testcases.py
index 53ea93f..fb8ac52 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -1116,6 +1116,8 @@ class LiveServerThread(threading.Thread):
             self.httpd.set_app(handler)
             self.is_ready.set()
             self.httpd.serve_forever()
+            for alias in connections:
+                connections[alias].close()
         except Exception as e:
             self.error = e
             self.is_ready.set()
diff --git a/tests/servers/tests.py b/tests/servers/tests.py
index 2331a0d..2012f3c 100644
--- a/tests/servers/tests.py
+++ b/tests/servers/tests.py
@@ -185,3 +185,32 @@ class LiveServerDatabase(LiveServerBase):
             ['jane', 'robert', 'emily'],
             lambda b: b.name
         )
+
+
+class LiveServerPersistentDatabase(LiveServerBase):
+
+    def test_connection_closing(self):
+        self.connection_closed = False
+
+        from django.db import connections, DEFAULT_DB_ALIAS
+        connection = connections[DEFAULT_DB_ALIAS]
+
+        # Mark connection as persistent
+        connection.close_at = None
+
+        # Monkey-patch to check when is it closed
+        original_close = connection.close
+        def wrapped_close():
+            self.connection_closed = True
+            return original_close()
+        connection.close = wrapped_close
+
+        # Force the LiveServerThread to open a connection
+        self.urlopen('/example_view/')
+
+        # Stop the server
+        self.server_thread.terminate()
+        self.server_thread.join()
+
+        # The connection must have been closed by the server
+        self.assertTrue(self.connection_closed)
