NEW YORK - Few American leaders have faced the battery of urban ills that confronted David Dinkins when he became New York City's first Black mayor in 1990.

AIDS. Crack cocaine. A soaring murder rate. Rampant homelessness. Racial discord.

Dinkins was elected with high hopes of turning things around, but he became a lightning rod for criticism in his one tumultuous term in office, especially for his handling of a riot in Brooklyn.

It wasn't until years later that he started getting credit for his efforts to reduce crime, heal divisions and lay the groundwork for the prosperous, tourist-friendly place that New York City became.

Dinkins died Monday night at age 93, according to his assistant at Columbia University, where he taught after leaving office, and by Mayor Bill de Blasio, his onetime staffer. The former mayor's death came just weeks after the death of his wife, Joyce, who died in October at age 89.

“David Dinkins believed that we could be better, believed we could overcome our divisions,” de Blasio said at a news briefing Tuesday. “He showed us what it was like to be a gentleman, to be a kind person no matter what was thrown at him. And a lot was thrown at him.”

A calm and courtly figure with a penchant for tennis and formalwear, Dinkins was a stark departure from both his predecessor, Ed Koch, and his successor, Rudy Giuliani - two combative and often abrasive politicians in a city with a world-class reputation for impatience and rudeness.

In his inaugural address, he spoke lovingly of New York as a “gorgeous mosaic of race and religious faith, of national origin and sexual orientation, of individuals whose families arrived yesterday and generations ago, coming through Ellis Island or Kennedy Airport or on buses bound for the Port Authority.”

But the city he inherited had an ugly side, too, and Dinkins' low-key, considered approach quickly came to be perceived as a flaw. Critics said he was too soft and too slow.

“Dave, Do Something!” screamed one New York Post headline in 1990, Dinkins' first year in office.

Dinkins did a lot at City Hall. He raised taxes to hire thousands of police officers. He spent billions of dollars revitalizing neglected housing. His administration got the Walt Disney Corp. to invest in the cleanup of then-seedy Times Square.

In recent years, he has gotten more credit for those accomplishments, credit de Blasio said Dinkins should have always had. De Blasio, who worked in Dinkins' administration, named Manhattan's Municipal Building after his mentor in October 2015.

Dinkins took office during a time of racial discord following the 1989 shooting death of Yusuf Hawkins, a Black teenager who was attacked by youths in a predominantly white Brooklyn neighbourhood.

“In that climate, he preached a gorgeous mosaic and proved that we could achieve the highest levels of municipal power in the nation's largest city, and he did it when the city was torn apart, the Rev. Al Sharpton said in an interview Tuesday. “He did it by having a balance of understanding the community's needs and the needs of the city.”

Dinkins didn't get fast enough results, though, to earn a second term.

After beating Giuliani, a Republican, by only 47,000 votes out of 1.75 million cast in 1989, Dinkins, a Democrat, lost a rematch by roughly the same margin in 1993.

Political historians often trace the defeat to Dinkins' handling of the Crown Heights riot in 1991.

The violence began after a car in the motorcade of an Orthodox Jewish religious leader struck and killed 7-year-old Gavin Cato, who was Black. During the three days of anti-Jewish rioting by young Black men that followed, a rabbinical student was fatally stabbed. Nearly 190 people were hurt.

A state report issued in 1993 cleared Dinkins of the persistently repeated charge that he intentionally held back police in the first days of the violence - but criticized him for not stepping up as a leader.

In a 2013 memoir, Dinkins accused the police department of letting the disturbance get out of hand, but also took a share of the blame, on the grounds that “the buck stopped with me.” He also blamed his election defeat on prejudice: “I think it was just racism, pure and simple.”

Giuliani, now President Donald Trump's personal lawyer, tweeted his condolences to Dinkins' family.

“He gave a great deal of his life in service to our great City,” the former mayor wrote. “That service is respected and honoured by all.”

New York Attorney General Letitia James, who herself shattered barriers as the state's first Black woman elected to statewide office, said the example Dinkins set inspired her throughout her own political career.

“I was honoured to have him hold the bible at my inaugurations because I, and others, stand on his shoulders,” she said in a statement.

Born in Trenton, New Jersey, on July 10, 1927, Dinkins moved with his mother to Harlem when his parents divorced but returned to his hometown to attend high school. There, he learned an early lesson in discrimination: Black people were not allowed to use the school swimming pool.

During a stint in the Marine Corps as a young man, a Southern bus driver barred him from boarding a segregated bus because the section for Black people was filled.

“And I was in my country's uniform!” Dinkins recounted years later.

While attending Howard University, the historically Black university in Washington, D.C., Dinkins said he gained admission to segregated movie theatres by wearing a turban and faking a foreign accent.

Back in New York with a degree in mathematics, Dinkins married his college sweetheart, Joyce Burrows, in 1953. His father-in-law, a power in local Democratic politics, channeled Dinkins into a Harlem political club. Dinkins paid his dues as a Democratic functionary while attending Brooklyn Law School, then went into private practice.

He was elected to the state Assembly in 1965, became the first Black president of the city's Board of Elections in 1972 and went on to serve as Manhattan borough president.

Dinkins' election as mayor in 1989 came after two cases under Koch exacerbated racial tensions: the rape of a white jogger in Central Park - for which five Black teenagers were convicted and later exonerated - and Hawkins' killing.

Dinkins defeated Koch, 50% to 42%, in the Democratic primary. But in a city where party registration was 5-to-1 Democratic, Dinkins barely scraped by Giuliani in the general election, capturing only 30% of the white vote.

His administration had one early high note. Newly freed Nelson Mandela made New York City his first stop in the U.S. in 1990. Dinkins had been a longtime, outspoken critic of apartheid in South Africa.

In that same year, though, Dinkins was criticized for his handling of a Black-led boycott of Korean-operated grocery stores in Brooklyn. Critics contended he waited too long to intervene. He ultimately ended up crossing the boycott line to shop at the stores - but only after Koch did.

During Dinkins' tenure, the city's finances were in rough shape because of a recession that cost New York 357,000 private-sector jobs in his first three years in office.

Meanwhile, the city's homicide toll soared to an all-time high, with a record 2,245 during his first year as mayor. There were 8,340 New Yorkers killed during the Dinkins administration - the bloodiest four-year stretch since the New York Police Department began keeping statistics in 1963.

In the last years of his administration, homicides began a decline that continued for decades. In the first year of the Giuliani administration, they fell from 1,946 to 1,561.

One of Dinkins' last acts in 1993 was to sign an agreement with the United States Tennis Association that gave the organization a 99-year lease on city land in Queens in return for building a tennis complex. That deal guaranteed that the U.S. Open would remain in New York City for decades, and tennis aficionado Dinkins was a regular attendee.

After leaving office, Dinkins was a professor at Columbia University's School of International and Public Affairs.

He had a pacemaker inserted in August 2008 and underwent an emergency appendectomy in October 2007. He also was hospitalized in March 1992 for a bacterial infection that stemmed from an abscess on the wall of his large intestine. He was treated with antibiotics and recovered in a week.

Survivors include his son, David Jr.; daughter, Donna; and two grandchildren.

Associated Press writers David B. Caruso and Karen Matthews and former AP writer Larry McShane contributed to this report.