Breake problem ?

Today as I tried to break for a stop sign
its kinda hard to explain but the break peddle felt kinda mushy and soft for a few seconds and I skidded few feet before i eventually came to a stop

the next stops were ok and the problem didnt occur, what caused this to happen ?