Marion Barry, the longtime mayor of the District of Columbia who staged a remarkable political comeback after a 1990 FBI sting videotaped him smoking crack cocaine, died early Sunday. He was 78.

Barry died shortly after midnight Sunday at the United Medical Center, after having been released from Howard University Hospital the previous day. 

No cause of death was immediately specified, but spokeswoman LaToya Foster said Barry collapsed outside his home. Barry had battled kidney problems stemming from diabetes and high blood pressure and underwent a kidney transplant in February 2009.

Barry had served as a member of the city council since 2005, winning re-election twice. He was often still referred to in his Ward 8 constituency as "Mayor Barry" despite not having held the office since 1999. 

"Marion was born a sharecropper's son, came of age during the Civil Rights movement, and became a fixture in D.C. politics for decades," President Obama said. "Through a storied, at times tumultuous life and career, he earned the love and respect of countless Washingtonians, and Michelle and I extend our deepest sympathies to Marion's family, friends and constituents."

D.C. Mayor Vincent Gray said in a statement. "He loved the District of Columbia and so many Washingtonians loved him. Marion was not just a colleague but also was a friend with whom I shared many fond moments about governing the city." 

Speaking at a 4 a.m. 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.

Barry was first elected mayor in 1978 after building a political career as an official of the Student Non-Violent Coordinating Committee and a local activist in Washington. Re-elected in 1982 and 1986, he was dubbed "Mayor For Life."

"I want to take the boards off of houses and put people in them," he said shortly after being sworn in in 1979. "I want to provide minimal care for all people, regardless of their financial situation. And I want to live out (Dr. Martin Luther) King's legacy of peace, brotherhood and survival."

But he gained international notoriety when he was filmed smoking crack in a downtown Washington hotel room with a female friend. He was convicted of a single count of drug possession -- jurors had deadlocked on most counts -- and sentenced to six months in prison.

Despite the embarrassment, Barry's political career was far from over. In 1992, he made it back to city government, winning a council seat representing the poorest of the city's eight wards. That victory helped propel him to a fourth, and final, term as mayor in 1994.

"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.

But his 1994 vote was divided sharply along racial lines and his political revival drew criticism from many. Congress moved to strip Barry of much of his mayoral authority in 1995 as the city flirted with bankruptcy.

Congress installed a financial control board, and Barry decided not to seek a fifth term. He held authority over little more than the city's parks, libraries and community access cable TV station in his last years as mayor.

"Marion Barry sadly turned the capital city into a national joke," then-Sen. Lauch Faircloth, R-N.C., said in May 1998.

In his later years on the council, Barry played the role of elder statesman, but he sometimes exasperated his colleagues with his wavering attention at meetings and frequent, rambling references to his tenure as mayor.

He also battled legal problems, including tax as well as drug charges. Even as he was fighting kidney disease in early 2009, prosecutors were seeking to revoke probation in a tax case, saying he had not kept a promise to file annual returns. The council also censured him twice for ethical violations.

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.

In 1970, The Washington Post wrote: "Four years ago widely considered a young Black Power Militant with almost no constituency, (Barry) has become a man who is listened to -- if not fully accepted -- on all sides."

Barry's activism propelled him into local politics, first as a member of the Board of Education and then in 1974 as a member of the first elected city council organized under home rule legislation.

He suffered his first personal crisis in 1977 when he was wounded by a shotgun blast in the Hanafi Muslim takeover of D.C.'s city hall. A young reporter was killed. The shooting was credited with strengthening him politically, and his first mayoral run was buoyed by an early endorsement from The Washington Post.

In 1978, he defeated incumbent Mayor Walter Washington -- the city's first home rule mayor -- in the Democratic primary and went on to easily win the general election.

The early years of Barry's long tenure were marked by improvement in many city services and a dramatic expansion of the government payroll, creating a thriving black middle class in the nation's capital. Barry established a summer jobs program that gave many young people their first work experience and earned him political capital.

During much of the period between 1984 and 1990, Barry was under federal investigation for his ties to drug suspects. He consistently denied using drugs, but his late-night partying began to take a toll on his job performance.

On Jan. 19, 1990, FBI agents videotaped him buying and smoking crack cocaine in a hotel room not far from the White House. The tape, which included his subsequent arrest, was widely distributed to the media and made Barry infamous worldwide.

A few months after his arrest, long-time civil rights advocate and educator Roger Wilkins, a past supporter, wrote in The Post: "Marion Barry used the elders and lied to the young. He has manipulated thousands of others with his cynical use of charges of racism to defend his malodorous personal failures."

Sharon Pratt Dixon was elected mayor later in 1990 and served one term before Barry retook city hall in the 1994 election. Asked if he had anything to say to his opponents, Barry said: "Get over it."

After retreating from mayoral politics in the late 1990s, Barry worked as a municipal bond consultant.

Several times since his 1990 arrest, Barry had sought treatment or counseling for problems with prescription medications or other substances. In 2002, he sought an at-large seat on the D.C. Council but abandoned his bid amid allegations of renewed illegal drug use.

In 2006, Barry was given three years of probation after pleading guilty to misdemeanor charges for failing to file tax returns from 1999 to 2004. As part of a plea bargain, he agreed to file future federal and local tax returns annually, a promise prosecutors later said he had failed to keep.

In 2010, he was censured by the council and stripped of his committee assignments for steering a government contract to a former girlfriend. The council levied a similar punishment in 2013 after he admitted accepting cash gifts from city contractors.

Barry suffered numerous health problems over the years. In addition to kidney failure, he survived prostate cancer, undergoing surgery in 1995 and a follow-up procedure in 2000. In late 2011, he underwent minor surgery on his urinary tract, and in early 2014, he spent several weeks in hospitals and a rehabilitation center while battling infections and related complications.

Barry was married four times and is survived by one son, Marion Christopher Barry.

The Associated Press contributed to this report.