expression
pardon me for leaving first; excuse me for leaving before you
A set phrase used when departing a workplace, meeting, or social gathering while others remain. It acknowledges that you are leaving ahead of them and shows consideration.
お先に失礼します。お疲れさまでした。
Excuse me for leaving first. Thank you for your hard work.
まだ会議が続いていますが、私はお先に失礼します。
The meeting is still going on, but I'll be leaving now.
A more general phrase for excusing oneself, entering a room, or interrupting. お先に失礼します adds お先に to specify leaving before others.
A polite set phrase combining お先に (before others) and 失礼します (excuse me). The exact historical origin is uncertain, but it is a standard expression in modern Japanese business and social etiquette.