How long a headache lasts after a fever depends on the cause of the headache. If the headache is vascular in nature, it usually resolves on its own within a few hours or days, and will not last more than 2-3 weeks. If the fever is caused by a central nervous system infection, the headache may persist until the central nervous system infection is completely cured, and there are more pathogens that cause central nervous system infections, so the time frame for healing varies. In the case of viral infections resulting in viral meningitis or viral encephalitis, most heal within 3-4 weeks of treatment and the headache will resolve. In the case of tuberculous meningitis or tuberculous meningoencephalitis caused by Mycobacterium tuberculosis infection, treatment may last for 3-6 months or even a year or more, during which the headache may strike at any time.