When the War of 1812 broke out, the citizens of St. Andrews had little to fear from their neighbors in Maine, because not everyone in New England supported the war and trade with Atlantic Canada was brisk; around St. Andrews, the main threat was privateering rather than invasion. Resolutions on both sides of the border declared a local truce, although in 1814 the British in Halifax invaded Northern Maine and occupied it until 1818. In the early 1800s, St. Andrews was a prosperous garrison town with a busy commercial seaport, and American privateers were expected to target ships with valuable cargoes or loot homes and businesses. Remembering that during the American Revolution privateers had attacked and robbed every port in the Maritimes except Halifax, defenders quickly erected three gun batteries and soon added three blockhouses to defend them. From inside, soldiers armed with muskets and a small cannon could defend the batteries and help protect shipping along the river and harbour. The 18-pounder guns could fire as far as Navy Island. The defenses worked: although privateers captured many ships at sea, they never attacked St. Andrews. Privateering remained a common wartime practice until the mid-1800s, as governments licensed private businesses and ships to seize enemy vessels and cargoes as prizes, and these largely legal American and British raids were frequent along the east coast during the War of 1812.