A new perovskite-like compound [N(CH3)4][Cd(N3)3] is reported here, which undergoes a series of reversible phase transitions including an above-room-temperature ferroelastic phase transition. An order-disorder mechanism is found in these structural transitions owing to the sway of the rod-like N3(-) bridges as well as the rotation of the tetrahedron-like [N(CH3)4](+) guests.