Bikes have been ridden off road since the first bicycles were invented.
The mountain bike first really took form in the 1970s, when modified chunky bikes were ridden to freewheele down mountain tracks in California.
Early mountain bikes often were refered to as Klunkers, and this word was also used to describe the activite, as the ter 'mountain biking' was not used yet. However, racing down fireroads caused the hubbrakes to burn the grease inside, meaning new innovations had to be come up with - leading to the first mountain bikes.
It wasn't until nearly the 1980s that manufatures started producing mountain bikes.
Joe Breeze is generally credited with making the first mountain bike in 1978, purpose built for the task. The first proper mountain bikes were really just road bikes with different tubing and geometry, such as using a wider frame and fork, therefore allowing for a wider tyre. The handlebars were also different. Specialized creatyed the 1st mass produced mountain bikes in 1983, with 15 gears.