past tense, perfective aspect (shimau auxiliary verb); 'finished doing X' or 'did X completely/unintentionally'
Analysis. Auxiliary verb attached to the stem of another verb (here understood from context). しまう expresses completion or an action done with regret or finality. In this form -ました is the polite past ending.
Dictionary entry by Claude.
Lite mode — plain HTML for e-readers and old browsers. Full version