Flight 214 had 307 people - 291 passengers and 16 crew - on board when it left Seoul.
The aircraft apparently struck a rocky area at the water's edge short of the runway at the airport - a major international hub, especially for flights to and from Asia.
"It is incredible and very lucky that we have so many survivors. But there are still many that are critically injured," said San Francisco Mayor Edwin Lee who also sent condolences to the families of those killed and hurt.
The plane's tail "hit the runway and the aircraft veered to the left out of the runway," South Korea's transportation ministry said in a statement Sunday from Seoul.
It was the first fatal crash involving an Asiana passenger plane since June 1993, when an Asiana Boeing 737 crashed into a mountain in South Korea, killing 68.
Pictures showed the tail detached from the fuselage, and the landing gear had also sheared off.
"At this time there are two fatalities," the city's fire chief Joanne Hayes-White said.
One of the two dead "carried a Chinese passport," and the nationality of the other victim was unclear, said Lee Jeong-Gwan, the foreign ministry's ambassador for overseas Koreans and consular affairs, told reporters, quoting a US forensic in touch with South Korean officials.
No one was unaccounted for, US officials said, revising downwards an earlier estimate of dozens. The remainder of those on board, 123, were uninjured.
The US Federal Bureau of Investigation (FBI) said there was no indication that terrorism was to blame for the crash.
Survivor Elliott Stone told CNN that as it came in to land, it appeared the plane "sped up, like the pilot knew he was short."
"And then the back end just hit and flies up in the air and everybody's head goes up to the ceiling."
Video footage showed the jet on its belly surrounded by firefighters with debris scattered on the runway and in the surrounding area.
"It looked normal at first the wheels were down," an unidentified man who witnessed the crash told CNN. "It just hit (the seawall) like that and the whole thing just collapsed immediately.
"It just pancaked immediately. The wings caught on the tarmac."
A team of experts from the National Transportation Safety Board was heading to San Francisco to investigate the crash landing.
A four-member South Korean government team was also heading to inspect the site of the accident, officials in Seoul said.
"Everything is on the table at this point," NTSB chairwoman Debbie Hersman told reporters in Washington when asked if pilot error was to blame. "We have to gather the facts before we reach any conclusions."
One dramatic photo tweeted by a survivor showed people streaming out of the jet following the crash-landing. An inflatable slide was at the front entrance. Other emergency exits also appeared to have been used.
"I just crash landed at SFO. Tail ripped off. Most everyone seems fine. I'm ok," the passenger, David Eun, wrote on Twitter.
But another photo from above showed a more distressing scene, with most of the roof of the plane missing and the cabin seating area charred by fire. The aircraft's wings were still attached.
"I saw some passengers bleeding and being loaded onto an ambulance," another passenger, Chun Ki-Wan, told YTN TV in Seoul.
"Everything seemed to be normal before it crash-landed."
Stone said he feared for the flight crew seated in the back of the plane, which took off in Shanghai, stopped in Seoul and then headed to the United States.
"They were sitting in the back end and got hammered because we landed short. And then they all fell out and it was just the most terrible thing I've seen," he said.
The airport was closed immediately after the incident but two runways later reopened. Some flights were diverted to Los Angeles.
Among those on board were 77 Koreans, 141 Chinese, 61 US citizens, and one Japanese national, Asiana said in a statement.
San Francisco General Hospital said it was treating 34 patients, five of them in critical condition.
Local media cited multiple witnesses who said the plane had approached the runway at an awkward angle, with several onlookers saying they then heard a loud bang.
"You heard a pop and you immediately saw a large, brief fireball that came from underneath the aircraft," Anthony Castorani, who saw the crash from a nearby hotel, told CNN.
The accident site was covered in white foam used by firefighters, with at least six fire trucks at the scene.
The White House said President Barack Obama had been briefed on the incident, noting: "His thoughts and prayers go out to the families who lost a loved one and all those affected by the crash."
Asiana is based in Seoul. The twin-engine 777 aircraft is one of the world's most popular long-distance planes, often used for flights of 12 hours or more, from one continent to another.