It is narrated from Ibn Abbas (may Allah be pleased with him) that he stated: The Messenger of Allah (peace be upon him) traveled between Makkah and Madinah in a state of security; he did not fear anyone except Allah, yet he performed two rak‘ahs of prayer (i.e., he shortened the prayer).
Hadith Referenceمسند الإمام الشافعي / كتاب الصلاة / 340
Hadith Takhrijأخرجه الترمذي: أبواب السفر، باب ما جاء في التقصير في السفر: 547 ۔ وقال حسن صحيح. والنسائي: تقصير الصلاة: 1436.