お疲れ様でした

Etymology
Consists of +, the  of verb  +  +.

Phrase

 * 1) I appreciate your efforts, thank you very much, good work

Usage notes
Can be used as a catch-all greeting of sorts when passing a coworker in the hall on the way home at the end of the day. The past-tense deshita on the end indicates that whatever the speaker is referring to is finished. Consequently, it is considered inappropriate for someone leaving work to say this to someone staying at work; in that case, would be used instead.