It was narrated that Ibn ‘Abbas said; ‘Umar said:
I was walking with a group of people during a campaign I went on with the Messenger of Allah (ﷺ) and I swore an oath, saying, No, by my father. A man behind me rebuked me for that and said: “Do not swear by your fathers,” I turned around and saw that it was the Messenger of Allah (ﷺ).