A Republican congressman has successfully pushed legislation to punish the U.S. Department of Justice for not cracking down on marijuana in states that have legalized its use.

"It is with growing alarm that we see this administration selectively executing and enforcing federal law," Rep. John Fleming (R-LA) said Wednesday on the House floor.

The Republican congressman noted the federal Controlled Substances Act outlawed the possession and sale of marijuana, even though states like Washington and Colorado have legalized it.

The Justice Department has agreed to allow states to enact laws that legalize the recreational and medical use of marijuana.

"The CSA sets forth five classifications or schedules for controlled substances. Marijuana, along with heroin and LSD, are schedule I drugs without accepted medical purpose and which have a high potential for abuse. Smoking marijuana remains a federal offense, and growers and distributors could and should be prosecuted," Fleming said.

"Despite DOJ's responsibility to uphold the CSA as the law of the land, over the last few months, the Department of Justice has issued several memos suggesting ways for states like Colorado and Washington to evade federal law and federal law enforcement and encouraging other states to follow suit with decriminalization and potentially legalization."

Fleming's amendment reduces the Department of Justice's Salaries and Expenses, Legal Activities account by $866,000.

"I am hopeful that my amendment will encourage DOJ to take steps necessary to correct any misunderstanding regarding the federal enforcement of the CSA," he remarked.

The amendment was agreed to on Thursday by a voice vote.

On Friday, a seemingly contradictory measure was passed. The House of Representatives approved an amendment to prohibit the federal agency from spending taxpayer money on activities designed to stop the use of medical marijuana in states in which such use is legal.

Watch video, uploaded to YouTube by Rep. Fleming, below.

[Correction: A previous version of this article incorrectly stated the Department of Justice would receive its funding back if the Attorney General enforced the Controlled Substances Act in every state.]