San Marino has one of the smallest military forces in the world. Its different branches have varied functions including: performing ceremonial duties; patrolling borders; mounting guard at government buildings; and assisting police in major criminal cases. There is also a military Gendarmerie which is part of the military forces of the republic. The entire military corps of San Marino depends upon the co-operation of full-time forces and their retained (volunteer) colleagues, known as the Corpi Militari Volontari, or Voluntary Military Force. National defence in the face of an aggressive world power is, by arrangement, the responsibility of Italy's armed forces. The component parts of the military (other than the purely historical Crossbow Corps) are distinguished (as in many nations) by distinctive cap badges, one each for the Fortress Guard (uniformed), Fortress Guard (artillery), Guard of the Council, Uniformed Militia, Military Ensemble (band), and Gendarmerie. There is no compulsory service, however under special circumstances citizens aged 16 to 55 may be drafted for the defence of the state.
Although once at the heart of San Marino's army, the Crossbow Corps is now an entirely ceremonial force of about 70 volunteer soldiers. The Crossbow Corps has a continuous history from its first mention in the national statutes of 1295. Described by the Government as "The oldest military formation in the Republic, nominated in the statutes of 1295", its uniform is medieval in design, and although it is a statutory military unit, it has no actual military function today. By the mid twentieth century the Crossbow Corps had become largely defunct, save for parading on state holidays; but in 1956 the practice of training its members in crossbow shooting was revived, and a 'Crossbow Federation' was formed to encourage competition in this art, so that the unit (although still entirely ceremonial in nature) now again has a very active existence.
The Guard of the Rock (Italian: Guardia di Rocca) is a front-line military unit in the San Marino armed forces. Its precise origin is difficult to pinpoint due to amalgamations. Its role was last redefined by statute in 1987, and it probably came into being as a military branch in 1754; however, the unit also uses the name "Fortress Guards" which may be traced back to much earlier units of Sammarinese military. The Guard of the Rock are the state border patrol, with responsibility for patrolling borders and defending them. In their role as Fortress Guards they are also responsible for the guarding of the Palazzo Pubblico in San Marino City, which is the seat of national government. In this role, they are the forces most visible to tourists, and known for their colourful ceremony of Changing the Guard. Under the 1987 statute, the Guard of the Rock are all enrolled as 'Criminal Police Officers' (in addition to their military role) and act to assist the police in investigating major crime.