Maryland residents have been buying guns in record numbers before a law takes effect Tuesday, with provisions aimed at helping keep guns away from criminals and the mentally ill, strengthening safety training and banning 45 types of assault weapons.

Opponents decry what they call an ineffective law that will only make it harder for law-abiding citizens to exercise Second Amendment rights. They say the state also failed to prepare properly for implementation after Gov. Martin O’Malley, who is considering a run for the White House in 2016, pushed the complicated measure through the General Assembly to build his credentials for a potential Democratic primary race

On Thursday, opponents of the restrictions sued in federal court in Baltimore, seeking to block the legislation from taking effect. The court scheduled a hearing for Tuesday on their motion for an order that would temporarily block implementation while the court considers whether to permanently bar Maryland from enforcing the law.