It's water. This explanation of what's happening is courtesy of Diana Cox.
Our bodies use glycogen for short term energy storage. Glycogen is not very soluble, but it is stored in our muscles for quick energy -- one pound of glycogen requires 4 lbs of water to keep it soluble, and the average glycogen storage capacity is about 2 lbs. So, when you are not getting in enough food, your body turns first to stored glycogen, which is easy to break down for energy. And when you use up 2 lbs of glycogen, you also lose 8 lbs of water that was used to store it -- voila -- the "easy" 10 lbs that most people lose in the first week of a diet.
As you stay in caloric deficit, however, your body starts to realize that this is not a short term problem. You start mobilizing fat from your adipose tissue and burning fat for energy. But your body also realizes that fat can't be used for short bursts of energy -- like, to outrun a sabertooth tiger. So, it starts converting some of the fat into glycogen, and rebuilding the glycogen stores. And as it puts back the 2 lbs of glycogen into the muscle, 8 lbs of water has to be stored with it to keep it soluble. So, even though you might still be LOSING energy content to your body, your weight will not go down or you might even GAIN for a while as you retain water to dissolve the glycogen that is being reformed and stored.