"Michelle and I were shocked and saddened by the news of yesterday's tragic train derailment in Santiago de Compostela, Spain," he said.
"On behalf of the American people, we offer our deepest sympathies and condolences to the families and loved ones of the more than 80 people who lost their lives."
The State Department said one American was among the dead, and five others had been injured, but cautioned that the numbers may change.
"We extend our wishes for a full recovery to those who were hurt," Obama said.
"We also offer our heartfelt gratitude to the government of Spain and to the rescue personnel who are working to locate the missing and treat the injured.
"Today the American people grieve with our Spanish friends, who are in our thoughts and prayers. We stand ready to provide any assistance we can in the difficult days ahead."
Spanish authorities have confirmed that 80 people were killed and 178 injured in Wednesday's dramatic accident, in which a high speed passenger express train jumped its rails and was torn in half.
State Department deputy spokeswoman Marie Harf said US consular staff were working with Spanish counterparts "to account for US citizens who need assistance."