The PM says legislation will overrule guidelines which prompted claims of “two-tier justice”.