President Donald Trump ordered flags at federal buildings throughout the United States to be flown at half-staff in "solemn respect" for victims of the California bar shooting.

Trump issued the proclamation Thursday morning after a gunman attacked a country music bar filled with college students in Southern California, killing 12 people, including a sheriff's deputy.

Flags should be flown at half-staff through sunset on Nov. 10.

Earlier on Thursday, Trump called the attack a "terrible shooting" and offered his condolences for the victims and their families on Twitter.

"Great bravery shown by police. California Highway Patrol was on scene within 3 minutes, with first officer to enter shot numerous times," Trump tweeted. "That Sheriff’s Sergeant died in the hospital. God bless all of the victims and families of the victims. Thank you to Law Enforcement."

It was the deadliest mass shooting in the U.S. since 17 students and teachers were killed at a Parkland, Florida, high school nine months ago. It also came less than two weeks after a gunman massacred 11 people at a synagogue in Pittsburgh. That, in turn, closely followed the series of pipe bombs mailed to critics of Trump.