Federal regulators cleared the way Friday for banks to serve marijuana businesses in states where selling the drug is legal.

Following the legalization of retail marijuana in the states of Washington and Colorado, the Justice Department and the Treasury Department's Financial crimes Enforcement Network released guidance to banks on how they could allow marijuana businesses to hold accounts without running afoul of federal law.

FinCEN Director Jennifer Shasky Calvery said in a release that her agency "seeks to move from the shadows the historically covert financial operations of marijuana businesses" and provide "financial institutions with clarity on what they must do if they are going to provide financial services to marijuana businesses and what reporting will assist law enforcement.”

Manufacturing, distributing, and dispensing marijuana remain illegal under the Controlled Substances Act. But the government's guidance released Friday indicates that banks can serve legal weed dealers if they cooperate with the priorities that the Justice Department spelled out in 2013 for dealing with drug-related crime.

Those priorities include stopping the sale of drugs to minors, preventing drug sales from financing crime, and stopping violence associated with growing or distributing drugs.

Banks would be required to report any such activities their clients engaged in to the Feds. The guidance released Friday spells out the steps that would be mandated and the paperwork involved in such reports.