Matthew 27:54

54 When the centurion and those with him who were guarding Jesus saw the earthquake and all that had happened, they were terrified, and exclaimed, “Surely he was the Son of God!”

Read Matthew 27:54 Using Other Translations

Now when the centurion, and they that were with him, watching Jesus, saw the earthquake, and those things that were done, they feared greatly, saying, Truly this was the Son of God.
When the centurion and those who were with him, keeping watch over Jesus, saw the earthquake and what took place, they were filled with awe and said, "Truly this was the Son of God!"
The Roman officer and the other soldiers at the crucifixion were terrified by the earthquake and all that had happened. They said, “This man truly was the Son of God!”

What does Matthew 27:54 mean?

John Gill's Exposition of the Bible
Matthew 27:54

Now, when the centurion
That was over the band of soldiers, that mocked Christ in Pilate's hall, and who was particularly over the guard of soldiers, set about the cross of Christ:

and they that were with him, watching Jesus:
the soldiers that were with him, who were set to watch the cross of Christ, lest he should come down, or any should take him down from thence; (See Gill on Matthew 27:36).

Saw the earthquake, and those things that were done;
as besides that, the darkening of the sun, the rending of the rocks, and particularly heard with what a loud voice Christ spoke, and then at once expired:

they feared greatly;
not with a true godly fear, but with a fear of punishment; lest divine vengeance should light on them, for their concern in this matter:

saying, truly this was the Son of God;
which they concluded, not from any mediatorial performances, which they were utter strangers to, but from effects of divine power; and which to them showed him to be a divine person, what he said he was, and the Jews charged him with blasphemy, on account of, and condemned him for, as these soldiers might have seen and heard.

California - Do Not Sell My Personal Information  California - CCPA Notice