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 and held a seat there for the following 23 years.
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.