Sunan an-Nasa'i, Book 22, Hadith 49 (Nasa'i 2143)

It was narrated that Abu Hurairah said:

"The Messenger of Allah said: The month may be twenty-nine days or it may be thirty. When you see it, then stop fasting, and it is obscured from you (too cloudy), then complete the count."'