A “horrific” explosion and fire at a dairy farm in the southern US state of Texas killed about 18,000 head of cattle and injured one agricultural worker, authorities said on Thursday.

“This was the deadliest barn fire for cattle in Texas history and the investigation and cleanup may take some time,” Texas Agriculture Commissioner Sid Miller said in a statement.

The explosion and fire ripped through the Southfork Dairy Farms near the town of Dimmitt in the Texas Panhandle on Monday night.

Firefighters and police rushed to the scene and “determined that one person was trapped inside,” the Castro County Sheriff’s Office said on Facebook. The person was rescued and flown to a hospital in Lubbock, it said.

The cause of the explosion and fire were not immediately clear, said Miller, who described it as a “horrific event.”

“Once we know the cause and the facts surrounding this tragedy, we will make sure the public is fully informed — so tragedies like this can be avoided in the future,” he said.

Castro County Sheriff Sal Rivera told the CBS affiliate in Amarillo that a system to remove manure from the barns may have gotten “overheated.”

He said methane may have “ignited and then spread out with the explosion and the fire,” adding that a probe would have to determine the precise cause.

“Farms must do more to protect animals by adopting commonsense fire safety measures,” tweeted the Animal Welfare Institute, one of the oldest animal welfare charities in the United States, referring to the Texas tragedy.