Investigators said Daniel Fanuele, 30, tried to kick down the door of the Presbyterian Church of the Moriches at 263 Main St. in Center Moriches just after noon on Tuesday.
Officials said Fanuele ran from the scene when an employee of the Gentle Hearts Preschool, which is located inside the church, confronted him.
No one inside the church was injured, but 19 young kids and two staff members were forced to shelter in place as a precaution until police arrived.
Almost three hours later, Suffolk County police arrested Fanuele at the intersection of Coventry Avenue and Mastic Road in Mastic about four miles from the church.
Suffolk County police charged Fanuele with third degree attempted burglary and criminal mischief.
He is expected to be arraigned at First District Court in Central Islip later today.