Well, I believe you need to have, both, Intrinsic and extrinsic motivation to learn a foreign language. Learning a foreign language is believed to be one of the hardest skills. You can only do that if you enjoy learning it or doing it to gain some extrinsic rewards.
I am absolutely passionate about learning and teaching English as a foreign language; I love the sound of it. Despite the fact I've always had an intrinsic motivation to learn English, I had a very similar experience when I had to sit CAE (Cambridge Advanced English) exam last year. I was aiming at C1 level and at times I felt I was never going to be able to do that but then I had to remind myself why I needed to do that in the first place - that's extrinsic motivation. Every time I felt demotivated, I would think of the reward and kept pushing. Eventually I did really well in the exam and earned a C2 level with a total score of 200/210.