The son of a clergyman, Bajer served as an officer in the Danish army, fighting in the 1864 war against Prussia and Austria where he was promoted to the rank of first lieutenant. He was discharged in 1865, and moved to Copenhagen where he became a teacher, translator and writer.
He entered the Danish Parliament in 1872 as a member of Folketinget and held a seat there for the following 23 years. As a member of parliament, he worked for the use of international arbitration to solve conflicts among nations, and it is due to Bajer's efforts that foreign relations became part of the work of the Danish Parliament and that Denmark participated in the Inter-Parliamentary Union from the beginning and earned a distinguished position among its members.
He supported many peace organizations, both inside Denmark and Europe-wide, and helped guide the passage of a bill to reach arbitration agreements with Sweden and Norway.
^Andersen, Holger (1953). "Den danske rigsdag og det interparlamentariske arbejde" (Danish) in Fabricius, Knud; Bomholt, Jul.; Hjelholt, Holger; Mackeprang, M.; Møller, Andr. (eds.): Den danske rigsdag 1849–1949 bind VI. Copenhagen: J. H. Schultz Forlag, pp. 415–416.