Well this is a sweeping statement, as it depends which country you are in, it would be interesting to see what case was involved, as it's a bit unusual for a court to use this phrase as they deal with only Legal cases.
Lawful = Common law, which is our rightful law.
Legal = Statute law, which are rules made by the state.
There is a huge difference between these, ie: all Traffic tickets are Unlawful under our Common laws, so they need to use statutes.
Bookmarks