Two people escaped serious injuries Saturday night after the car they were in crashed into a historic cemetery and burst into flames. 

Wayne Allen, 28, of Harpswell was driving his 2008 Kia Sportage on Cundy’s Harbor Road when he swerved to avoid hitting an animal and careened into Cranberry Horn Cemetery, according to the Cumberland County Sheriff’s Office. 

The car struck several trees and headstones before rolling over onto its side and catching fire, officials said. 

Allen and his passenger were able to exit the vehicle before it caught fire and were treated and released from the scene. 

Excessive speeds were a contributing factor in the crash, which resulted in the total loss of the vehicle and damage to the cemetery, officials said.