President Ferdinand Marcos declared martial law on September 21, 1972 and Ocampo, among others, went underground. In 1973, Ocampo co-founded the National Democratic Front, seeking to unite various anti-dictatorship forces.
In 1976, he was arrested and incarcerated as a political prisoner. For the next nine years he was severely tortured in various prison camps. At one point, he shared a cell with detained Philippine Collegian editor-in-chief Abraham Sarmiento, Jr. Though tried by a military court for rebellion, he was never found guilty. In 1985, while on pass to vote at the National Press Club annual elections, he escaped from the soldiers guarding him and rejoined the underground revolutionary movement.
After the dictatorship fell in 1986, and President Corazon Aquino called for peace talks and Ocampo headed the NDF peace negotiating panel. When the talks collapsed due to the killing of 18 farmers at a rally near the Malacañan Palace on January 22, 1987, Ocampo returned to the underground.
In 1989, he was rearrested together with his wife, Carolina Malay. Three years later in 1992, a year after his wife was released, he was freed. Neither was found guilty of any crime.