Mesoporous self-assembled cobalt oxide (Co3O4) of different shapes was synthesized by a facile soft-chemical process using cobalt nitrate, oxalic acid and phosphoric acid in the presence of cationic templates, cetyltrimethylammonium bromide, 1-butyl-3-methylimidazolium bromide, and pyridinium bromide at 75 °C/2 h followed by calcination at 300 °C.