Push brakes to the floor before stopping..happens about 50% of the time. Cause? on 1999 Land Rover Range Rover

Sometime when I push on the brakes the pedal stops at midway...other times I have to push it almost to the floor. When the pedal stops midway the longer I have my foot on the pedal it will eventually go all the way to the floor. Cause and cure?