It's a fine line between anxiety and depression. They often seem to blend together so you don't know which is which. If you have anxiety symptoms it's easy to get depressed about them.
It's usually that way round I think, if the reasons for your anxiety resolve then the depression often disperses too. But anxiety doesn't always disperse when the causes for it are no more.
High anxiety can cause over sensitisation of the nervous system. It takes time for sensitised nerves to return to normal during which time the symptoms of anxiety continue. These involve us in hugely over reacting to things that should be treated as minor worries.
A simple stomach ache has us convinced it must be a tumour. A new boss means we're going to lose our job for sure. The normal desire not to die before our time becomes a feeling of impending doom and death. The symptoms of anxiety are legion but they are all lies, none of it true. It's really sensitised nerves talking.
As you've discovered, this can last for years because the symptoms/bad feelings cause fear. The fear causes more adrenaline which causes more nervous sensitisation. Which causes more symptoms. Which cause more fear. Which causes more adrenalin and nervous sensitisation. Which causes more symptoms. You're caught in a vicious circle that's hard to break out of.
But you can break out of the self-perpetuating cycle no matter how long or how deeply you have suffered. I'll give you the short version.
Stop fighting the bad feelings. Fighting causes more trauma and tension, the very last thing to help you recover. Instead, simply accept all the bad feelings for the time being. Agree to co-exist with them for the moment. Let them come, you know they are really only nervous hiccups caused by jangled nerves. Short circuits in the system caused by anxiety overload.
Frame your mind to completely accept the bad feelings and do so fearlessly. Why be frightened half to death by a mere 'feeling' no matter how bad the experience. The idea is to starve your nervous system of the fear hormone that's keeping your nervous system over sensitised.
Millions of people have regained their quiet mind through Accepance during the past 50 years. But it's no quick fix, you have to let time pass before you feel the symptoms and bad feelings subside.
The point is that when we recover from anxiety and its symptoms we often recover from depression too. Because our prime reason for being depressed has resolved.