Born in Ambato to José marcos Montalvo and Josefa Fiallos, he studied philosophy and law in Quito before returning to his hometown in 1854. He held diplomatic posts in Italy and France from 1857 to 1859. A political liberal, Montalvo's beliefs were marked by anti-clericalism and a keen hatred for the two caudillos that ruled Ecuador during his life: Gabriel García Moreno and Ignacio de Veintemilla. After an issue of El Cosmopolita viciously attacked Moreno, Montalvo was exiled to Colombia for seven years. Moreno's assassination was attributed to Montalvo's writings. He was a dedicated champion of democracy and an enemy of the writer Juan León Mera.
In the late seventies Juan Montalvo was twice exiled to France, remaining there from 1879, as punishment for Las catilinarias (1880), the work that made him famous throughout intellectual circles in the United States, Europe and the rest of Latin America. Alongside full-length books, Montalvo was an accomplished essayist, and his Siete Tratados (1882) and Geometría Moral (published in 1902, after his death) were popular in Ecuador and were banned by Veintemilla
He also wrote a witty sequel to Miguel de Cervantes's Don Quixote, called Capítulos que se le Olvidaron a Cervantes ("Chapters Cervantes Forgot"), published posthumously in 1895. He died of tuberculosis in Paris. His mummified body now rests in a mausoleum in his birthplace of Ambato.