From Wiktionary, the free dictionary
The perfective form of しまう (shimau, “to finish”), literally meaning “finished”. Compare Mandarin 完了 (wánle).
しまった • (shimatta)
- used in response to a failure or mistake: dang, shoot, darn it
- Synonyms: やば (yaba), はあ (hā), 詰んだ (tsunda) (if the situation has no solution)