D.C. Councilman Marion Barry said Thursday that the 18-month-old federal investigation into Mayor Vincent Gray's 2010 campaign is holding the city "hostage."

Barry, the city's longest-serving mayor who now represents Ward 8 on the D.C. Council, faulted prosecutors for the lengthy nature of their probe, which is ongoing and has already netted three guilty pleas.

"This is what they do: They drag things out," said Barry, who tangled with federal authorities in 1990, and was convicted of cocaine possession. "It's not good for the city."

Barry, who ultimately served a six-month prison sentence, made his remarks during an interview for "Q & A Cafe with Carol Joynt," which will air on television within a few weeks.

Barry also said the investigation, led by U.S. Attorney Ronald Machen Jr., who is black, could be seen through a racial lens.

Although Barry said the probe was not racially motivated, "it has racial overtones."

Gray's campaign has been under investigation since March 2011 after Sulaimon Brown, a minor mayoral candidate, went public with allegations that Gray's team paid him to remain in the race and criticize incumbent Mayor Adrian Fenty.

Two Gray campaign lieutenants have pleaded guilty to their roles in the scheme, though the mayor has repeatedly denied wrongdoing.

Prosecutors are also looking into an illegal $653,800 shadow campaign that helped to elect Gray. According to court filings, that campaign, which city contractor Jeffrey Thompson is believed to have financed, helped to pay for signs, T-shirts and staff members.

A onetime communications aide to Gray has pleaded guilty to helping execute the shadow campaign, though Thompson has not been charged.

Machen has said the investigation is ongoing and has declined to give a timeline for when his team will finish the probe.

Machen was not the only prominent figure to draw Barry's ire during the interview.

Barry also criticized President Obama for what he perceived as a relaxed position toward the District's quest for statehood.

"He hasn't fought enough for statehood," Barry said. "The country has spent trillions to promote democracy in Iraq and Afghanistan, but what about here?"

Examiner columnist Harry Jaffe contributed to this report.