An aide for California Senator Barbara Boxer (D) was arrested Tuesday for attempting to bring marijuana into a Senate office building.

Boxer's now-former senior economic adviser, Marcus M. Stanley, was attempting to gain access to the Constitution Avenue door of the Hart Office Building when a U.S. Capitol Police officer noticed Stanley remove an item from his pocket and attempt to conceal it. Upon closer inspection, the item appeared to be a "green leafy substance," which further analysis revealed contained THC, the primary psychoactive compound found in marijuana.

Stanley was released from Capitol Police custody Tuesday and is scheduled to appear in D.C. Superior Court Thursday morning.

"Marcus Stanley is no longer with this office," Boxer spokesman Zachary Coile told Fox News. "He submitted his resignation and Senator Boxer accepted it because his actions yesterday were wrong and unacceptable."

Boxer is in the middle of a tough reelection campaign against former Hewlett Packard CEO Carly Fiorina. The latest Rasmussen poll released this week puts Boxer and Fiorina in a virtual dead heat for the seat, with the Republican challenger leading 48 percent to Boxer's 47 percent.

California voters are considering an item on the November ballot to legalize pot, which Boxer opposes. But at least in D.C., it's still illegal.