A man wearing tactical-style clothing and carrying a loaded firearm and extra ammunition who said he was on his way to a Texas church to “fulfill a prophecy” was arrested early on Sunday morning, officials said.

The man, identified by the police as Tony D. Albert, 33, of Houston, was taken into custody in Seguin, Tex., a city about 35 miles east of San Antonio. He did not say which church he planned to go to, Officer Tanya Brown of the Seguin Police Department said.

It was still dark outside when Mr. Albert, who was wearing sunglasses, stopped at Las Mañanitas restaurant around 6:30 a.m. A worker there, Brianna Jimenez, 18, went to greet him but he waved her off and he went into the restroom for close to 30 minutes, she said.

“I totally forgot he was in there,” Ms. Jimenez said on Sunday. When Mr. Albert, who was carrying a backpack, left the restroom, he turned to Ms. Jimenez.