Divisive and flamboyant, maddening and beloved, Marion Barry outshone every politician in the 40-year history of District of Columbia self-rule. But for many, his legacy was not defined by the accomplishments and failures of his four terms as mayor and long service on the D.C. Council.

Instead, Barry will be remembered for a single night in a downtown Washington hotel room and the grainy video that showed him lighting a crack pipe in the company of a much younger woman. When FBI agents burst in, he referred to her with an expletive. She "set me up," Barry said.

Barry died Sunday at 78. His family said in statement that Barry died shortly after midnight at the United Medical Center, after having been released from Howard University Hospital on Saturday. No cause of death was given, but his spokeswoman LaToya Foster said he collapsed outside his home.

Speaking at a 4 a.m. ET press conference at United Medical Center, the city's mayor-elect Muriel Bowser called Barry an "inspiration to so many people and a fighter for people."

"Mr. Barry, I can say this, lived up until the minute the way he wanted to live," said Bowser, who had served with Barry on the D.C. Council.

The year was 1990, and crack cocaine had exploded in the district, turning it into the nation's murder capital. In his third term, the man known as the "Mayor for Life" became a symbol of a foundering city.

Federal authorities had been investigating him for years for his alleged ties to drug suspects, and while he denied using drugs, his late-night partying was taking a toll on his job performance.

The arrest and subsequent conviction — a jury deadlocked on most counts, convicting him of a single count of drug possession — was a turning point for Barry. He had been elected to his first term as mayor in 1978 with broad support from across the city. With his good looks, charisma and background in the civil rights movement, he was embraced as the dynamic leader the city's young government needed. The Washington Post endorsed him in each of his first three mayoral runs, although the 1986 endorsement was unenthusiastic.

Hero to low-income blacks

Barry's six-month term in federal prison was hardly the end of his political career. But it forever changed how it was perceived. To some, he was a pariah and an embarrassment. But to many district residents, particularly lower-income blacks, he was still a hero, someone unfairly persecuted for personal failures.

This file frame is from the infamous Marion Barry videotape. He staged a comeback after his 1990 crack cocaine arrest. (Barry Thumma/Associated Press) Barry returned to the D.C. Council in 1992, representing the poorest of the city's eight wards. Two years later, he won his fourth and final term as mayor. The electorate was starkly divided along racial lines, and Barry advised those who had not supported his candidacy to "get over it."

"Marion Barry changed America with his unmitigated gall to stand up in the ashes of where he had fallen and come back to win," poet Maya Angelou said in 1999.

Barry's triumph, though, was short-lived. In 1995, with the city flirting with bankruptcy from years of bloated, unaccountable government, much of it under Barry, Congress stripped him of much of his power and installed a financial control board. Barry held authority over little more than the city's parks, libraries and community access cable TV station. He decided against seeking a fifth term.

Returned to council in 2004

Barry spent a few years working as a municipal bond consultant, but he couldn't stay away from politics. In 2004, he returned to the council, again representing Ward 8, where he remained beloved. Many constituents still referred to him as "Mayor Barry," and he was re-elected in 2008 and 2012.

Barry was born March 6, 1936, to Marion and Mattie Barry, in the small Mississippi delta town of Itta Bena, and was raised in Memphis, Tenn., after the death of his father, a sharecropper.

While an undergraduate at LeMoyne College (now LeMoyne-Owen College), Barry picked up the nickname "Shep" in reference to Soviet propagandist Dmitri Shepilov for his ardent support of the civil rights movement. Barry began using Shepilov as his middle name.

Barry did graduate work in chemistry at Fisk University in Nashville, Tenn., earning a master's degree. He left school short of a doctorate to work in the civil rights movement.

His political rise began in 1960, when he became the first national chairman of the Student Non-Violent Coordinating Committee, which sent young people into the South to register black voters and became known as one of the most militant civil rights groups of that era.

Barry's work with the committee brought him to Washington, where he became immersed in local issues, joining boycotts of the bus system and leading rallies in support of the city's fledgling home rule efforts.