Esquire is “an unofficial title of respect, having no precise significance, sometimes placed, especially in its abbreviated form, after a man's surname in formal written address: in theU.S., usually applied to lawyers, women as well as men; in Britain, applied to a commoner considered to have gained the social position of a gentleman”, “a polite title appended to a man’s name when no other title is used, typically in the address of a letter or other documents […]; North American a title appended to the surname of a lawyer (of either sex)”.
The title dates back to the Middle Ages in England. The term was used for men that were aspirants for receiving a knighthood. Later on it was used for dignitaries like sheriffs, sergeants and justices. In the United States “Esquire” evolved as a term used exclusively for lawyers, but only in common parlance, not as a legally valid title.