I am remembering parts of a movie in which shelling from a war woke an old alien machine. The machine turned humans into soldiers for itself. The machine was defeated when a jaded religious man used a broken sword as a key to initiate the machines takeoff sequence.

Question is closed for new answers.
Selected answer as best