Captain armed forces Wikipedia
The military rank of captain was in use from the 1560s referring to an officer who commands a company. The naval sense an officer who commands a manofwar is somewhat earlier from the 1550s later extended in meaning to quotmaster or commander of any kind of vesselquot.