August 6, 2013: Kristin Davis, center, leaves Manhattan federal court with her attorney Daniel Hochheiser, left, in New York. Davis, a former madam running against former Gov. Eliot Spitzer in the race for New York City comptroller, peddled hundreds of powerful painkillers and other prescription pills in exchange for Ecstasy and cash from a drug dealer wearing a wire, federal authorities said Tuesday. (AP Photo)

Kristin Davis, the former madam at the center of the Eliot Spitzer prostitution scandal who is now running against the former New York governor for New York City Comptroller, was released on bail Tuesday after being arrested for selling prescription drugs to an FBI informant.

The Associated Press reported that Davis, 38, was released on $100,000 bail and ordered to undergo drug testing following an initial court appearance.

Davis faces four counts of distributing and possessing with intent to distribute a controlled substance. Each count carries a possible sentence of up to 20 years in prison.

According to a criminal complaint, Davis began buying Xanax, Adderall, and Ecstasy from an unidentified drug dealer in 2009.

In 2011, Davis asked the dealer if he would accept Adderall in exchange for Ecstasy, the complaint says. After that, they traded 240 Adderall pills for 120 Ecstasy tablets, it says.

Authorities arrested the dealer in December and he agreed as part of guilty plea to record his conversations with Davis, the complaint says. In a recorded meeting on Jan. 7, the cooperator paid Davis $675 in cash for 215 pills, it says.

"OK, and this one is Ambien. There are 30 of those," Davis allegedly said on tape.

Authorities also alleged that in April, Davis brokered a deal for another person to sell 180 oxycodone pills to the cooperator. The complaint references a video that shows Davis bringing the person to the dealer's apartment, where the dealer used $3,600 provided by the FBI to make the purchase.

In 2008, around the time that Spitzer resigned the governorship over his patronization of the high-end prostitution service Emperors Club VIP, Davis claimed that she had sent call girls Spitzer's way as well, primarily while he served as New York's attorney general. Spitzer has always denied any dealings with Davis, and her allegations have never been proven.

Davis attempted a third-party run for Governor of New York in 2010 on the Anti-Prohibition Party line.