diff --git a/src/OpenSSL/crypto.py b/src/OpenSSL/crypto.py
index <HASH>..<HASH> 100644
--- a/src/OpenSSL/crypto.py
+++ b/src/OpenSSL/crypto.py
@@ -2450,6 +2450,7 @@ def load_publickey(type, buffer):
 
     pkey = PKey.__new__(PKey)
     pkey._pkey = _ffi.gc(evp_pkey, _lib.EVP_PKEY_free)
+    pkey._only_public = True
     return pkey
 
 
diff --git a/tests/test_crypto.py b/tests/test_crypto.py
index <HASH>..<HASH> 100644
--- a/tests/test_crypto.py
+++ b/tests/test_crypto.py
@@ -2427,6 +2427,20 @@ def _runopenssl(pem, *args):
     return output
 
 
+class TestFunctions(object):
+    """
+    py.test-based tests for the free functions in the crypto module.
+
+    If possible, add new tests here.
+    """
+    def test_load_publickey_sets_only_public(self):
+        """
+        _only_public should be set on PKeys loaded with load_publickey.
+        """
+        key = load_publickey(FILETYPE_PEM, cleartextPublicKeyPEM)
+        assert key._only_public is True
+
+
 class FunctionTests(TestCase):
     """
     Tests for free-functions in the :py:obj:`OpenSSL.crypto` module.
fix a small bug with load_publickey (#<I>)

* fix a small bug with load_publickey



* update docstring, rename test method



* make hynek happy