SAN FRANCISCO — As a string trio played, a long stream of mourners filed past the body of the late San Francisco Mayor Ed Lee to say goodbye to their leader of seven years.

His body lay in repose in a closed casket draped with the American flag, behind velvet ropes and with two guards. People stopped briefly to bow and pray, and then moved into a side hall to write their condolences.

Lee, 65, was San Francisco's first Asian-American mayor and presided over the city as it climbed out of a recession and into a boomtown driven by tech.

He died early Tuesday after collapsing at a Safeway, leaving the city reeling from shock and dealing with the logistics of selecting a new leader. The medical examiner has not released a cause of death.

"I'm here to pay my respects to Ed Lee," said Matthew Saccomanno, 20, a nursing student at San Francisco State University. "He was a great mayor. He was a great man with a great heart."

Saccomanno said he respected the mayor for trying to make life affordable in an increasingly unaffordable city, and for tackling climate change, an issue important to young people.

Earlier Friday, a police motorcade escorted the body to City Hall, where a giant American flag has been hoisted up by the ladders of two firetrucks.

The funeral procession drove through several San Francisco neighborhoods, including Glen Park, where Lee lived. Police officers lined the steps and saluted as the casket was carried up the steps and into City Hall.

The last mayor to lie in repose in the rotunda was George Christopher, who led the city from 1956 to 1964 and died in 2000. Mayor George Moscone and Supervisor Harvey Milk, both assassinated in 1978, also laid in repose in the rotunda.

Lee was elected in 2011 and re-elected in 2015 after being appointed to serve the remainder of former Mayor Gavin Newsom's term in 2011. He was a civil rights lawyer and longtime San Francisco administrator known for his corny sense of humor and dedication to public service.

Supporters say Lee didn't receive enough credit for working to build affordable housing and battling homelessness. Critics say Lee didn't do enough to stand up to tech companies after he lured the industry to San Francisco with a tax break in 2011.