A contract may be ruled to be illegal by any court of law. Illegality can become an issue even if the normal requirements of acceptance of offers, consideration, contractual capacity, are present. Illegal contracts typically do not result in any liability for the involved parties. The courts may rule an illegal contract exists regardless of whether or not the parties involved in the suit raise the issue, even if the two parties believe the contract to be legal.
Severable and/or Divisible Contracts
A severable or divisible contract may be formed by the parties to the contract or may result from actions of the courts. The parties can create a severable contract by including a severence clause into the original contract. A severance clause is a clause which states that if there is one other contractual clause that would cause the contract to be considered illegal, then the offending phrase should be stricken from the contract, so long as the removal of the clause does not substantially alter the original nature of the contract.
Divisible contracts are similar contracts entered into by the same parties which have similar terms but can be completed independently of each other. A court may form a severable contract by utilizing a blue pencil test. If the offending phrase in a contract can be removed from the contract without enacting any change besides turning an illegal contract into a legal one, then the change passes the blue pencil test.