The President was the keynote speaker Friday at the U.S. Conference of Mayors being held in the San Francisco Union Square Hilton hotel.
Some 277 mayors from across the country are in San Francisco for the annual conference to exchange ideas on how to battle common problems such as homelessness, failing infrastructure and strained relations between police and the community.
"We put in a concerted effort in working together, but working together making sure there's a level of trust. The community trusts the police, and the police trust the community," said Mayor Eric Jackson of Trenton, New Jersey.
Taking center stage, the President started off by acknowledging the Golden State Warriors' Championship team, as they celebrated their NBA title on the other side of the Bay.
"I know how excited the Bay Area is over the Golden State Warriors Championship," he said.
At least one mayor was not so thrilled. "We are very sad about it. It was hard for me to come to California," said Mayor Nan Whaley from Dayton, Ohio, referring to the Cleveland Cavaliers' loss to the Warriors.
The light-hearted talk quickly turned to more serious issues.
Then, he addressed the mayors gathered from around the nation and talked about the shooting Wednesday night at the Emmanuel AME Church in Charleston. President Obama urged Congress and the mayors to take action with more gun control measures.
"It is not good enough to simply show sympathy. You don't see murder on this kind of scale with this kind of frequency, in any other advanced nation on earth," the President said.
By 3:30 p.m., the motorcade departed for a Democratic fundraiser on Nob Hill at the home of venture capitalist Shervin Pishevar. The small group of high end donors talked with the President about technology for about one hour.
Then, the motorcade headed across town for a fundraiser at the Seacliff home of billionaire environmentalist Tom Steyer and Kat Taylor.
More than 50 guests paid between $10,000 - $33,400 to meet the President and House leader Nancy Pelosi. Guests told KTVU, it was a very intimate event and the President talked about the environment as well as gun control.
Passersby paused near police barriers, hoping to get a glimpse of the President.
"It's very exciting, I'm a big fan of his and wish him well and it's great to have him in San Francisco," Justin Murray of San Francisco who was waiting on the sidewalk.
The motorcade, led by dozens of San Francisco police on motorcycles roared onto Lake Street about 6 p.m. and headed back downtown where President Obama spent the night at the Intercontinental Hotel.
The Secret Service closed several blocks surrounding the President's hotel Friday night, frustrating drivers who honked their horns in standstill traffic Friday night along Howard Street.
President Obama is scheduled to leave San Francisco Saturday and travel to Palm Springs. His visit coincides with former Secretary of State Hillary Clinton, who is campaigning for the Democratic Presidential nomination.
She is scheduled to speak on Saturday to the U.S. Conference of Mayors.