President Trump appeared to offer his condolences for the wrong mass shooting on Tuesday in a late-night Twitter post, which was later deleted.

“May God be with the people of Sutherland Springs, Texas. The FBI and Law Enforcement has arrived,” Mr. Trump said in a Twitter post at 11:34 p.m., soon after arriving back in the United States from his 12-day trip through Asia.

That attack occurred more than a week ago, on Nov. 5, when a gunman opened fire at a church, killing 26 and wounding 20 others. Another mass shooting took place early Tuesday, as a gunman in California opened fire at an elementary school and other locations, killing at least four people and injuring several others before he was fatally shot by the police.

It was not immediately clear whether the error was caused by a sloppy cut-and-paste job by a jet-lagged president or some other issue. A spokesman for the White House did not respond to emails seeking an explanation.