Ignorance of the law is the lack of knowledge about a statute, resulting in commission of a crime without being aware of it. Most legal systems believe in the principle that ignorance of the law is not an excuse, and will hold defendants liable for violations of the law even if they can demonstrate that they were not aware. There are some exceptions to this rule, such as cases where there is no way a defendant could have known about a law and this can be clearly proved. For the most part, the legal system assumes knowledge of the law.
The argument goes that if ignorance of the law was a valid defense, accused individuals could always claim they didn't know about the law, and couldn't be held liable. Proving ignorance is difficult, and thus this could provide a mechanism for escaping justice. The justice system assumes knowledge on the grounds that laws are publicly available in a number of formats, and members of the public can ask for advice from government officials if they are not certain about the legality of a given activity. This can play into the idea of “willful blindness,” where a defendant does not seek advice about an activity to avoid knowing whether it is legal in the hopes of avoiding liability.
There are some exceptions to the general rule that ignorance of the law is no excuse. One is a situation where a law changes and a person could not be aware of it. For example, someone hiking in a very remote area without communications devices wouldn't be aware of changes to the law made and announced during this period; if that person broke fishing or hunting laws after a change, she could plead ignorance of the law on the grounds that she had no way of knowing about the change.
Likewise, bad advice from officials can be a mitigating factor, although it is not usually accepted as a defense. This means that a person will be convicted of the crime, but may have a reduced or waived sentence because he sought advice from a government representative and was given bad information. In this case, the defendant operated on the belief that his actions were legal because he was told they were by someone in a position to know.
Ignorance of fact is regarded separately from ignorance of the law. In cases where ignorance of fact clearly plays a role, this can be considered a defense in a case. This came up in a 2010 Supreme Court case about debt collectors, where the justices ruled that placing a call outside legal hours was defensible if the debt collectors had incorrect information about the time zone. In this case, the company acts on bad factual information while trying to comply with the law, and is not held accountable for not having the right facts.