Ocean City firefighters enter St. Paul's by-the-sea Episcopal Church as flames roll up the wall of the rectory in Ocean City on Tuesday. (Grant L. Gursky/AP)

A man on fire entered the offices of an Ocean City church Tuesday morning, sparking a blaze that left him and the rector of St. Paul’s by-the-Sea dead and critically injured a third person, a preliminary investigation has found.

Fire officials said they are still trying to determine how John Raymond Sterner, 56, of Ocean City came to be on fire and whether he was intentionally trying to set a blaze or whether it was an accident. The fire quickly engulfed the rectory building of the historic church, which is near the resort town’s boardwalk.

“It’s quite a unique incident,” said Jessica Waters, an Ocean City spokeswoman. “There are still pieces we don’t know.”

The chain of events began about 9:25 a.m. when Sterner entered the three-story building with a “significant amount” of flames on him, officials said. Waters said Sterner was a patron of Shepherd’s Crook, a food pantry and clothing store for the poor and homeless that is run out of the building.

The fire quickly spread, possibly with the help of an accelerant, officials said.

A fire breaks out in Ocean City next to a church. (Youtube/wbalam)

Firefighters quickly knocked down the blaze but not before it claimed Sterner’s life and that of the Rev. David Dingwall, 51, who had been rector of St. Paul’s since 2005. Dingwall was found unconscious on the second floor of the building and rushed to the hospital, along with a church volunteer, who was injured while exiting the building, officials said.

Dingwall died Tuesday night, and the volunteer remains in critical condition, Waters said. Officials declined to identify her.

Canon Heather Cook, an official with the Episcopal Diocese of Easton, said witnesses told diocese officials that Sterner was screaming for help when he entered the building and embraced the volunteer. Cook said that the woman’s clothes caught on fire and that the flames spread to the rectory building, which is old and largely made of wood. Cook said that Dingwall might have made it out of the building but that he returned for a computer.

Bishop James J. Shand of the diocese said another volunteer was slightly injured by the flames. The man had originally planned to grab a fire extinguisher to douse the flames on Sterner but couldn’t get close enough, Shand said.

Fire officials could not confirm either account.

Cook said Dingwall will be greatly missed.

“I will remember him as a bright fellow with a charming sense of humor,” Cook said. “He had a great heart for the community.”

Cook said Dingwall had a distinctive look — a pierced ear and brightly colored Crocs shoes that he would wear during services. Cook said Dingwall was instrumental in creating a community ministry with a $1 million donation left by a benefactor. He was married and has three sons.

Waters said there was only minor damage to the sanctuary area of the church, which has 240 parishioners and was founded in 1878.

“Short time, this is a tragedy, but I think in the long term, it will be a rallying point for our service to the community,” said St. Paul’s parishioner Mark Larsen.