Sergeant major is a senior non-commissioned rank or appointment in many militaries around the world. In Commonwealth countries, the various degrees of sergeant major are appointments held by warrant officers. In the United States, there are also various grades of sergeant major (command sergeant major, Sergeant Major of the Army, Sergeant Major of the Marine Corps), but they are all of the same pay grade of E-9. However, the Sergeant Major of the Army and the Sergeant Major of the Marine Corps, as their respective service's Senior Enlisted Advisor, receive a special rate of basic pay that is higher than all other sergeants major.
In 16th century Spain, the sargento mayor ("sergeant major") was a general officer. He commanded an army's infantry, and ranked about third in the army's command structure; he also acted as a sort of chief of staff to the army's commander.
In the 17th century, sergeant majors appeared in individual regiments. These were field officers, third in command of their regiments (after their colonels and lieutenant colonels), with a role similar to the older, army-level sergeant majors (although obviously on a smaller scale). The older position became known as "sergeant major general" to distinguish it. Over time, the term sergeant was dropped from both titles, giving rise to the modern ranks of major and major general.
The full title of sergeant major fell out of use until the latter part of the 18th century, when it began to be applied to the senior non-commissioned officer of an infantry battalion or cavalry regiment. It is about this time that the U.S. and British histories of the title diverge, with the American Revolutionary War.