Malatesta was introduced to Mazzinian republicanism while studying medicine at the University of Naples, but he was expelled from the university in 1871 for joining a demonstration. Partly via his enthusiasm for the Paris Commune and partly via his friendship with , he joined the Naples section of the International Workingmen's Association that same year, as well as teaching himself to be a mechanic and electrician. In 1872, he met Mikhail Bakunin, with whom he participated in the St. Imier Congress of the International. For the next four years, Malatesta helped spread Internationalist propaganda in Italy; he was imprisoned twice for these activities. Following Bakunin, Malatesta became a freemason at Naples on 19 October 1875, hoping to influence younger members. However, when the lodge organised a reception honouring Giovanni Nicotera, the Interior Minister, Malatesta left on 18 March 1876 and became anti-Masonic.