After the revolution, Soekotjo continued to serve within Brawijaya. Some time before the 30 September movement in 1965, he had been assigned as commander of the military district (Kodim) in Surabaya with the rank of colonel. He was appointed as acting mayor of the city on 4 November 1965, and was later officially appointed as full mayor on 14 September 1967. The purges against the Indonesian Communist Party occurred during his early tenure, and Soekotjo enforced new residency requirements while purging PKI members in neighborhood associations in his first months in office. He further ordered the clearance of squatters in the city's roads and riverbanks, with the squatter neighborhoods being seen as communist strongholds and potential hiding locations. The municipal government also rounded up the homeless, including some of the displaced squatters, and signed them up for the transmigration program.
