A major state has approved a landmark overhaul as part of a crackdown on crime, with MPs debating well past midnight.