WASHINGTON — President Barack Obama and other political leaders on Sunday mourned Marion Barry, Washington’s flamboyant and flawed former four-term mayor whose political career survived a highly publicized 1990 drug arrest after he was caught on videotape smoking crack cocaine.

Barry, 78, died early Sunday morning at Washington’s United Medical Center. No cause of death was given, but Barry had many ailments, including diabetes, prostate cancer and kidney problems.

“During his decades in elected office in D.C., he put in place historic programs to lift working people out of poverty, expand opportunity, and begin to make real the promise of home rule,” Obama said, referring to a 1973 provision that gave the district some control over its governance from Capitol Hill. “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 today.”

Barry rose from a sharecropper’s son to become a civil rights activist and the longest-serving elected mayor of the nation’s capital. Barry’s tenure and larger-than-life personality earned him the nickname “Mayor for Life.”

He was elected mayor in 1978, 1982 and 1986, and, after his 1990 arrest, came back and was elected a fourth and final time in 1994.

Barry was a popular yet polarizing figure in the city he represented and beyond. He battled drug and alcohol abuse, married four times and divorced three, and wrestled with the Internal Revenue Services over unpaid taxes.

Obama and lawmakers didn’t ignore Barry’s flaws while in eulogizing him Sunday.

“Barry’s personal demons could not obscure his deep and abiding love for the city and its people,” said Rep. Debbie Wasserman Schultz, D-Fla., chair of the Democratic National Committee, in a statement.

“He transformed D.C. from a jurisdiction run by the federal government into a self- governing city and a mecca for black politicians, government administrators, businessmen and intellectuals,” Rep. John Lewis, D-Ga., said in a statement Sunday. “He used his influence and power to lay a foundation for the thriving, metropolitan community people flock to today.”

Detractors countered that he loaded the district government with hacks and cronies. District residents often complained of poor services like spotty trash pickup, iffy snow removal and long lines at the Department of Motor Vehicles.

Several Barry opponents grumbled that he too often dabbled in the politics of race, pitting the district’s largely African-American population against its mostly white, often southern, congressional overseers who controlled the district’s purse strings.

And Washington, like many other major American cities in the 1980s, struggled to cope with the crack cocaine epidemic. On Jan. 18, 1990 Barry became the poster child of that struggle with his arrest, caught on videotape.

Marion S. Barry Jr., was born March 6, 1936, in Itta Bena, Miss. He attended LeMoyne College and earned a degree in chemistry in 1958. While earning his graduate degree in chemistry at Nashville’s Fisk University, Barry organized a campus NAACP chapter.

In 1960, he was among the student leaders who met with the Rev. Dr. Martin Luther King, Jr., and established the Student Nonviolent Coordinating Committee. Barry was elected the organization’s first national chairman.

“As chairman, he testified on behalf of the students and the movement before the Democratic and Republican conventions in 1960,” said Lewis, a former SNCC member.

Barry settled in Washington in 1965 and made a name for himself with his community organizing skills and oratory style. He lobbied aggressively for home rule and methodically worked his way up the political ladder.

In 1971, he was elected to an at-large seat on the district’s school board. Three years later, he won an at-large position on the city council. In 1978, Barry was elected mayor.

After his drug arrest and conviction, he was convicted of misdemeanor cocaine possession and sentenced to six months in jail.

However, the episode didn’t derail his political career. After serving his sentence, Barry was elected again to the City Council. In 1994, he defeated Mayor Sharon Pratt Kelly in a Democratic primary and went on to reclaim city hall for a fourth time.