French, from Middle French, from enclaver to enclose, from Vulgar Latin inclavare to lock up, from Latin in- + clavis key
The word enclave entered the English jargon of diplomacy in 1868. It derives from French, which was then the lingua franca of diplomacy, with a sense inherited from Late Latin inclavatus meaning shut in, locked up (with a key, Latin clavis). The word exclave is a logical extension created three decades later.
Although the meanings of both words are close, an exclave may not necessarily be an enclave or vice versa. For example, Kaliningrad, an exclave of Russia, is not an enclave because it is surrounded not by one state, but by two: Lithuania and Poland; it also borders the Baltic Sea. Conversely, Lesotho is an enclave in South Africa, but it is not politically attached to anything else, meaning that it is not an exclave.
In British administrative history, subnational enclaves were usually called detachments or detached parts. In English ecclesiastic history, subnational enclaves were known as peculiars (see also Royal Peculiar).
A country surrounded by another but having access to the sea is not considered to be an enclave, regardless of size. For this reason Portugal is not an enclave of Spain, and Gambia is not an enclave of Senegal.
An exclave, on the other hand, is a territory legally or politically attached to another territory with which it is not physically contiguous.