diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
 # Change log for "tls"
 
+## Version 2.5.2
+
+* Order key_share as supported_groups.
+  [#642](https://github.com/haskell-tls/hs-tls/pull/642)
+
 ## Version 2.5.1
 
 Sessions saved by 2.5.0 cannot be resumed: `SessionData` has a new field.
diff --git a/Network/TLS/Crypto/Types.hs b/Network/TLS/Crypto/Types.hs
--- a/Network/TLS/Crypto/Types.hs
+++ b/Network/TLS/Crypto/Types.hs
@@ -110,7 +110,10 @@
 --   implementation.
 supportedNamedGroups :: [Group]
 supportedNamedGroups =
-    [ X25519 -- 128 bits security
+    [ X25519MLKEM768
+    , P256MLKEM768
+    , P384MLKEM1024
+    , X25519 -- 128 bits security
     , P256 -- 128 bits security
     , P384 -- 192 bits security
     , X448 -- 224 bits security
@@ -120,9 +123,6 @@
     , FFDHE4096 -- 150 bits security
     , FFDHE6144 -- 175 bits security
     , FFDHE8192 -- 192 bits security
-    , X25519MLKEM768
-    , P256MLKEM768
-    , P384MLKEM1024
     , -- , MLKEM512
       MLKEM768
     , MLKEM1024
diff --git a/Network/TLS/Handshake/Client.hs b/Network/TLS/Handshake/Client.hs
--- a/Network/TLS/Handshake/Client.hs
+++ b/Network/TLS/Handshake/Client.hs
@@ -67,7 +67,11 @@
     handshake cparams ctx grps Nothing
   where
     groupsSupported = supportedGroups (ctxSupported ctx)
-    groupsSelected = onSelectKeyShareGroups (clientHooks cparams) groupsSupported
+    -- RFC 9846 Section 4.3.8: key shares follow "supported_groups" in its
+    -- order, whatever the hook returns.
+    groupsSelected =
+        let selected = onSelectKeyShareGroups (clientHooks cparams) groupsSupported
+         in filter (`elem` selected) groupsSupported
 
 -- https://tools.ietf.org/html/rfc8446#section-4.1.2 says:
 -- "The client will also send a
diff --git a/Network/TLS/Parameters.hs b/Network/TLS/Parameters.hs
--- a/Network/TLS/Parameters.hs
+++ b/Network/TLS/Parameters.hs
@@ -441,7 +441,7 @@
     --   The default value includes all groups with security strength
     --   of 128 bits or more.
     --
-    --   Default: @[X25519,P256,P384,X448,P521,FFDHE3072,FFDHE4096,FFDHE6144,FFDHE8192,X25519MLKEM768,P256MLKEM768,P384MLKEM1024,MLKEM768,MLKEM1024]@
+    --   Default: @[X25519MLKEM768,P256MLKEM768,P384MLKEM1024,X25519,P256,P384,X448,P521,FFDHE3072,FFDHE4096,FFDHE6144,FFDHE8192,MLKEM768,MLKEM1024]@
     , supportedGroupsTLS13 :: [[Group]]
     -- ^ The inside @[Group]@ is the list of @Group@ at the same level
     -- in preferred order.  The inside @[Group]@s are also listed in
@@ -721,6 +721,8 @@
     -- ^ A function to select groups in "key_share" by TLS 1.3 client.
     --
     --   Client's 'supportedGroups' is passed as the 1st argument.
+    --   The result is put in the order of 'supportedGroups', and
+    --   groups not in it are dropped (RFC 9846 Section 4.3.8).
     --
     --   The default function specifies a pair of hybrid (classical +
     --   post quantum) group and classical group to transit from
diff --git a/test/HandshakeSpec.hs b/test/HandshakeSpec.hs
--- a/test/HandshakeSpec.hs
+++ b/test/HandshakeSpec.hs
@@ -288,6 +288,10 @@
             handshake13_mldsa_wrong_scheme
         it "rejects an X25519MLKEM768 key share with a zero X25519 part" $
             handshake13_x25519mlkem768_zero_x25519
+        it "orders key_share as supported_groups by default" $
+            handshake13_key_share_order id
+        it "orders key_share as supported_groups whatever the hook returns" $
+            handshake13_key_share_order (const [FFDHE2048, X25519, X25519MLKEM768])
         prop "can handshake with TLS 1.3 Post-handshake auth" post_handshake_auth
         prop
             "delivers data while an asynchronous post-handshake auth is pending"
@@ -3235,6 +3239,49 @@
         | grp == X25519MLKEM768 =
             KeyShareEntry grp $ B.take 1184 key <> B.replicate 32 0
     zeroEntry kse = kse
+
+-- RFC 9846 Section 4.3.8: the key shares appear in the order of
+-- supported_groups.  FFDHE2048 is not in the default supported_groups.
+handshake13_key_share_order :: ([Group] -> [Group]) -> IO ()
+handshake13_key_share_order hook = do
+    CSP13 (cli, srv) <- generate arbitrary
+    let select = hook . onSelectKeyShareGroups defaultClientHooks
+        params =
+            ( cli
+                { clientSupported =
+                    (clientSupported cli){supportedGroups = supportedNamedGroups}
+                , clientHooks = (clientHooks cli){onSelectKeyShareGroups = select}
+                }
+            , srv
+                { serverSupported =
+                    (serverSupported srv)
+                        { supportedGroups = supportedNamedGroups
+                        , supportedGroupsTLS13 = supportedGroupsTLS13 defaultSupported
+                        }
+                }
+            )
+    hellos <- newIORef []
+    withPairContextWith (id, id) params $ \(cctx, sctx) -> do
+        contextHookSetHandshakeRecv sctx $ \hs -> do
+            case hs of
+                ClientHello ch -> modifyIORef hellos (ch :)
+                _ -> return ()
+            return hs
+        concurrently_ (handshake sctx) (handshake cctx)
+    chs <- readIORef hellos
+    chs `shouldNotBe` []
+    forM_ chs $ \ch -> do
+        let exts = chExtensions ch
+            groups = case extensionLookup EID_SupportedGroups exts
+                >>= extensionDecode MsgTClientHello of
+                Just (SupportedGroups gs) -> gs
+                Nothing -> []
+            shares = case extensionLookup EID_KeyShare exts
+                >>= extensionDecode MsgTClientHello of
+                Just (KeyShareClientHello kses) -> map keyShareEntryGroup kses
+                _ -> []
+        shares `shouldNotBe` []
+        shares `shouldSatisfy` (`isSubsequenceOf` groups)
 
 serverRejectedZeroX25519 :: TLSException -> Bool
 serverRejectedZeroX25519 (HandshakeFailed (Error_Protocol msg alert)) =
diff --git a/tls.cabal b/tls.cabal
--- a/tls.cabal
+++ b/tls.cabal
@@ -1,6 +1,6 @@
 cabal-version:      2.0
 name:               tls
-version:            2.5.1
+version:            2.5.2
 license:            BSD3
 license-file:       LICENSE
 copyright:          Vincent Hanquez <vincent@snarc.org>
