(CNN) San Francisco Mayor Edwin Lee, a former civil rights attorney who became the first Asian-American to serve in the city's top post, died early Tuesday -- hours after appearing at a public event -- at a city hospital at age 65, his office said.

Lee, who had been mayor since 2011, had suffered a heart attack while shopping at a Safeway grocery store Monday night, said US House Minority Leader Nancy Pelosi, who represents San Francisco in Congress. Lee's office didn't release his cause of death.

"I don't know San Francisco without Ed Lee," former Mayor Willie Brown told CNN affiliate KPIX . "He clearly had ... a lot more to give to the city. I'm going to miss him personally, and I think the city will miss him."

An ambulance delivered Lee to Zuckerberg San Francisco General Hospital shortly after 10 p.m. Monday in critical condition, and he died at 1:11 a.m. Tuesday after attempts to save his life, the hospital's CEO, Dr. Susan Ehrlich, said.

Ehrlich said Lee's family asked that the hospital share no further medical information for now.

Board of Supervisors President London Breed became acting mayor when Lee died, the mayor's office said, citing succession rules in the city's charter. She is the city's first black female chief executive.

London Breed, president of San Francisco's Board of Supervisors, has become acting mayor.

"Our mayor was a good man with a good heart," Breed said Tuesday morning. "He believed above all else in building bridges and solving problems."

"Our thoughts and prayers are with (Lee's) wife, Anita, his two daughters, Brianna and Tania, and his entire family," Breed said.

Shook people's hands at an event hours beforehand

Lee had been expected to conduct meetings Tuesday at City Hall, according to his official schedule. On Monday, he attended a city event promoting a recycling program and was seen smiling and shaking hands, CNN affiliate KGO reported

Lee, a Seattle native and the son of Chinese immigrants , graduated from Maine's Bowdoin College in 1974 and earned his law degree at the University of California, Berkeley, in 1978.

After becoming a civil rights attorney, he began decades of work in city government in the late 1980s , when he was named investigator for the city's first whistle blower's ordinance. Serving under four mayors, he would become human rights commission director, city purchaser and public works director.

In 2011, the Board of Supervisors appointed Lee, then the city administrator, to fill the rest of the term of Mayor Gavin Newsom, who left to become California's lieutenant governor.

Lee was elected to his own term later in 2011 and re-elected in 2015 as mayor of the consolidated city-county government.

Serving as the first Asian-American mayor,- in a county where more than 35% of residents are of Asian descent , is part of "the height of his legacy," said Brown, the mayor from 1996 to 2004.

"Unlike all the rest of us (who) got elected -- we got elected by our own skills to convince people and to sell people on us as an idea -- Ed Lee earned that title by demonstration of being an efficient person who could manage a huge enterprise like San Francisco," Brown told KPIX.

Trumpeted San Francisco as a sanctuary city

Lee unabashedly trumpeted San Francisco as a sanctuary city for undocumented immigrants -- meaning it generally doesn't comply with federal requests for help with identifying and deporting them -- and opposed President Donald Trump's executive order aimed at stripping such cities of federal funding.

After a US district court judge blocked the order in November , Lee issued a statement saying the city was "vindicated once again," and that San Francisco "is proud to be a sanctuary city today, tomorrow and always."

Pelosi told CNN on Tuesday that Lee was a "man of the people," and that his death was heartbreaking.

Heartbroken to hear of the passing of @mayoredlee. He was a true champion for the people & a dear friend to the many lucky enough to know him. My deepest love & prayers are with his wife Anita & daughters Brianna & Tania. Read my full statement here: https://t.co/gGHaQfaXEZ pic.twitter.com/uFBPPS9OK5 — Nancy Pelosi (@NancyPelosi) December 12, 2017

"All who knew Mayor Lee understood him as a true gentleman of great warmth, positivity and kindness," Pelosi said in an official statement. "His passing is not only a tragic official loss for our city but also a profound personal loss for all who were fortunate enough to call him friend."

We were deeply saddened and shocked to learn of the sudden passing of Mayor Ed Lee. He was a true San Franciscan who devoted his life to serving our great city and to supporting those most in need. He was the Giants' number one fan (con'd) pic.twitter.com/G2a3dHXmzV — San Francisco Giants (@SFGiants) December 12, 2017

Laurence M. Baer, the CEO of the San Francisco Giants, saluted Lee's service and called him the professional baseball team's top fan.

"He was a true San Franciscan who devoted his life to serving our great city and to supporting those most in need," Baer said. "He was the Giants' No. 1 fan and we are blessed to have shared so many wonderful memories together."

Election set for June

Voters will elect someone to fill the rest of Lee's term on June 5, City Attorney Dennis Herrera said. The term expires January 8, 2020.

Until the vote, Breed would remain acting mayor unless the board of supervisors decides to replace her with an interim mayor, Herrera said. Breed still retains the board presidency, Herrera said.

The board does not have to replace Breed as acting mayor, and the panel had no plans to address the matter on Tuesday, Herrera said.