In U.S. law, a title (name suffix) given to justices of the peace and other inferior court officers such as lawyers. Often abbreviated, as: James Jones, Esq. In English law and colonial U.S. law, a title above Gentleman and (in England) below knight, and also applied to sheriffs, sergeants, magistrates, and others.

Source: Black's Law Dictionary, 4th Edition. For more detail see Wikipedia