He was son of a clergyman born in Næstved in 1837. 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.