The decades following the Rebellions of 1837–1838 marked the start of intelligence services in Canada. Defeat in the failed uprising caused the restoration of colonial regimes and the reform of imperialism. As a result, informal intelligence services were formed to conduct certain activities. 1864 marked the formation of two secret police forces and the formal intelligence service in Canada. Created to protect the Canada–United States border, these organization were under the control of a Montreal police commander and political ally. In response to a number of raid and attacks connected with Irish nationalism, Prime Minister John A. Macdonald merged the two forces to form the Dominion Police (DP). The DP was subsequently merged with the North-West Mounted Police to form the Royal North-Wes