In 1990, federal agents - who had long pursued Mr Barry - videotaped him smoking crack with a girlfriend in a Washington hotel room. The tape was widely shown on television and Mr Barry left office in disgrace but has always made clear that he did not consider his political career was over.
He stands an outside chance of winning because of the widespread unpopularity of Sharon Pratt Kelly, the current mayor, who has failed to stem an increased crime rate or reverse deteriorating economic conditions. John Ray, the third candidate, who is close to developers and is expected run a well-financed campaign, said: 'I'm not going to allow Marion Barry to hustle the city again.'
As mayor of Washington in the 1980s Mr Barry, who had been a prominent civil-rights leader in the 1960s, was one of the most influential figures in black American politics. Benefiting from the construction boom in the capital during his years in office, he was at first successful in winning large subsidies from Congress but his administration also had a reputation for widespread corruption.
Since being released from jail in 1992 Mr Barry says he has broken his cocaine habit and has settled down, marrying his fourth wife.
Elected to represent a working-class black ward across the Anacostia river in east Washington, he has tirelessly worked to rehabilitate himself politically.
He has also been helped by worsening conditions in the capital. The murder rate in Washington, a city of 600,000 people, of whom two-thirds are black, is one of the highest in the nation. Businesses and wealthier white and black home-owners continue to move to the suburbs, reducing the city's tax base. Investigation of the local housing authority this year revealed that nobody applying for subsidised housing was helped unless a bribe was paid.
Mayor Pratt Kelly has alienated support by such acts as spending dollars 40,000 (pounds 26,700) for a granite fireplace for her office and billing the city for her personal make-up artist who prepares her for television appearances.
She is expected to benefit from Mr Barry standing in the 13 September primary, because the vote against her will be split and many white voters may support her in order to keep him out of office.Reuse content