diff --git a/psycopg/psycopg/types/json.py b/psycopg/psycopg/types/json.py
index 7ec732a6a..f69c923ad 100644
--- a/psycopg/psycopg/types/json.py
+++ b/psycopg/psycopg/types/json.py
@@ -18,6 +18,7 @@
 from ..pq import Format
 from ..adapt import AdaptersMap, Buffer, Dumper, Loader, PyFormat
 from ..errors import DataError
+from .._encodings import conn_encoding
 
 JsonDumpsFunction: TypeAlias = Callable[[Any], str | bytes]
 JsonLoadsFunction: TypeAlias = Callable[[str | bytes], Any]
@@ -250,12 +251,22 @@ class _JsonLoader(Loader):
     def __init__(self, oid: int, context: abc.AdaptContext | None = None):
         super().__init__(oid, context)
         self.loads = self.__class__._loads
+        enc = conn_encoding(self.connection)
+        # json.loads() can auto-detect the UTF encodings from the input
+        # bytes; for other connection encodings the data must be decoded
+        # explicitly (#1504).
+        self._encoding = "" if enc in ("utf-8", "ascii") else enc
 
     def load(self, data: Buffer) -> Any:
+        return self.loads(self._decode(data))
+
+    def _decode(self, data: Buffer) -> str | bytes:
         # json.loads() cannot work on memoryview.
         if not isinstance(data, bytes):
             data = bytes(data)
-        return self.loads(data)
+        if self._encoding:
+            return data.decode(self._encoding)
+        return data
 
 
 class JsonLoader(_JsonLoader):
@@ -276,9 +287,7 @@ class JsonbBinaryLoader(_JsonLoader):
     def load(self, data: Buffer) -> Any:
         if data and data[0] != 1:
             raise DataError(f"unknown jsonb binary format: {data[0]}")
-        if not isinstance((data := data[1:]), bytes):
-            data = bytes(data)
-        return self.loads(data)
+        return self.loads(self._decode(data[1:]))
 
 
 def _get_current_dumper(
diff --git a/tests/types/test_json.py b/tests/types/test_json.py
index f649ebdf3..b49c78541 100644
--- a/tests/types/test_json.py
+++ b/tests/types/test_json.py
@@ -127,6 +127,18 @@ def test_load_copy(conn, val, jtype, fmt_out):
     assert got == json.loads(val)
 
 
+@pytest.mark.crdb_skip("encoding")
+@pytest.mark.parametrize("jtype", ["json", "jsonb"])
+@pytest.mark.parametrize("fmt_out", pq.Format)
+def test_load_non_utf8_encoding(conn, jtype, fmt_out):
+    # The loaders must decode the server data with the connection encoding,
+    # not always as UTF-8 (#1504).
+    cur = conn.cursor(binary=fmt_out)
+    conn.execute("set client_encoding to latin1")
+    cur.execute(f"select %s::{jtype}", ('{"a": "\xe9"}',))
+    assert cur.fetchone()[0] == {"a": "\xe9"}
+
+
 @pytest.mark.parametrize("fmt_in", PyFormat)
 @pytest.mark.parametrize("wrapper", ["Json", "Jsonb"])
 def test_dump_customise(conn, wrapper, fmt_in):
