A Montgomery County man was arrested early yesterday after he allegedly ransacked and set fire to a Baptist church building in Rockville, causing up to $500,000 in damage before a maintenance worker, arriving before dawn, discovered him and called police.

The suspect, Lee Andrew Records, 25, of Gaithersburg, allegedly entered the two-story brick building on the grounds of Montrose Baptist Church after prying open a door sometime before 4:30 a.m.

Montgomery authorities said he set at least two fires; used a baseball bat to smash interior windows, doors, bookshelves, electric typewriters and audiovisual equipment; and left obscenities on a blackboard.

The building, one of three on the church grounds at 5100 Randolph Rd., houses a day-care center, a large multipurpose room and administrative offices for the 2,700-member church and its school.

The fires, although confined mostly to one end of the building, heavily damaged the first-floor day-care center and the upstairs multipurpose room, which students use as a gym.

The brick church and the 500-student school, which closely flank the burned building, were not damaged, police said.

"I didn't believe it until I saw it, and I thought, 'God has a very interesting plan in store for us,' " said the Rev. Robert Crowley, the church's pastor, who urged about 200 congregation members at yesterday's service to find comfort in their faith and to pray for the suspect.

Sgt. Harry Geehreng, a police spokesman, said that the writings on the blackboard were lewd sexual references and that authorities found no obvious reason to classify the incident as an act of religious hatred.

"He told us that he was acting alone, and we don't have any reason to disbelieve him," Geehreng said of Records, who was charged with arson, burglary and destruction of property, and jailed in lieu of $150,000 bail.

In a statement to investigators after his arrest, Records was "very sorry and very apologetic for what happened," Geehreng said.

"The only thing left unknown is motive," he said.

Fire officials estimated the damage at $250,000 to $500,000. Crowley said the church is "completely insured."

"I'm stunned and very saddened," said Judy Belva, of Northwest Washington, echoing other worshipers who arrived for the mid-morning service and found yellow crime-scene tape stretched across the church's driveway.

"But when you're most deeply shaken is when you most turn to God," Belva said.

Crowley said a church maintenance employee, Joseph Middleton, arrived for work about 4:30 a.m. to clean the floor of the multipurpose room, which had been used for basketball games on Saturday.

"That's his hours, he's been working those hours for 24 years," Crowley said. " . . . And had he not been here, probably the whole complex would have gone up."

Geehreng said Middleton, after discovering the break-in, rushed to a convenience store two blocks away and called police.

Records, who allegedly fled from the building when officers arrived, was arrested at a nearby apartment complex after a foot chase, Geehreng said.

Church officials said the day-care center, serving about 150 children, will be closed at least until Wednesday.

The strains of "Keep Your Eyes on Jesus" had barely faded from the church organ at the end of yesterday's service when the noise of hammers and power saws rose up. Workers were fastening plywood over the building's blackened window frames.

Steve Stevens, a church deacon, stood watching.

"Like the Bible says, it's going to be tough sometimes," he said.