Consequently, the lineages of some Canadian army units stretch back to the early 19th century, when militia units were formed to assist in the defence of British North America against invasion by the United States.