It is narrated from Abdullah bin Umar (may Allah be pleased with them) that the Messenger of Allah (peace be upon him) said: "The night prayer is in sets of two rak'ahs, then when one fears that dawn is approaching, he should pray one rak'ah, and that will make all his prayer odd."
Hadith Referenceمسند الإمام الشافعي / كتاب الصلاة / 384
Hadith Takhrijاخرجه البخاري، الوتر، باب ماجاء في الوتر (990) ومسلم صلاة المسافرين، باب صلاة الليل مثنى مثنى والوتر ركعة من آخر الليل (749)