A fire on the Gaviota Coast sparked some necessary teamwork Wednesday night as Santa Barbara County sheriff’s deputies detained an arson suspect armed with a sword and County Fire crews battled the blaze he allegedly started.

Simon Khalili, 40, from Woodland Hills was arrested after he fled from authorities and allegedly started a fire within State Parks property, Sheriff’s Office spokeswoman Raquel Zick said.

Around 5:15 p.m. Wednesday, deputies responded to the area of El Capitan Canyon Resort for a report of a suspect exhibiting “odd behavior,” Zick said.

As they arrived on scene, Khalili attempted to flee in his vehicle onto a dirt access road. His vehicle got stuck, and he fled on foot into the canyon, according to Zick.

Minutes later, a fire erupted in the brush where Khalili fled within State Parks property and deputies learned he was possibly armed with a sword, the Sheriff’s Office said.

Deputies and county firefighters briefly retreated to give a County Air Support helicopter room for two water drops onto the fire, according to Zick.

Deputies then developed a plan in which they would shield firefighters, allowing them to respond to the fire while Khalili remained an active threat, Zick said. A sheriff’s K9 unit arrived to assist while Air Support watched overhead.

At approximately 7:30 p.m., Khalili surrendered to deputies and was taken into custody. County Fire stopped the fire progression at 7:41 p.m., with an estimated 1.1-acre burn area.

Khalili was booked into the Santa Barbara County Main Jail on a felony charge of arson as well as misdemeanors, including trespassing, brandishing a weapon and negligent fire setting. His bail was set at $75,000, according to Zick.