Exercise is more critical than diet to maintain weight loss. The study showed successful weight-loss maintainers rely on physical activity to remain in energy balance (Rather than chronic restriction of dietary intake) to avoid weight regain. Successful weight-loss maintainers are individuals who maintain a reduced body weight of 30 pounds or more for over a year. The study, published in the March issue of Obesity, was selected as the Editor's Choice article. Source 7o.
In my opinion it depends more on your situation, for obese/fat people it's all about your diet then when you lose a considerable amount of weight you use exercise to break it down further, and of course 'maintain' it according to the article.