A master-at-arms (US: MA; UK and some Commonwealth: MAA) may be a naval rating, responsible for law enforcement, regulating duties, security, anti-terrorism/force protection (AT/FP) for a country's navy; an army officer responsible for physical training; or a member of the crew of a merchant ship (usually a passenger vessel) responsible for security and law enforcement. In some navies, a ship's corporal is a position—not the rank—of a petty officer who assists the master-at-arms in his various duties. Historically, a master-at-arms was responsible for the training of soldiers during peace time, or actively involved in leading the defense of a fortification during war time.
In some countries, the term navy police is used for a part of a navy responsible for law enforcement, such as the Royal Navy Police, known as the Royal Navy Regulating Branch until 2007.