Necromancers are humanoids and historical figures that learn their arcane arts from engraved slabs received from their gods, a sort of opposite, and parallel, to night creatures that are cursed by their gods. They often write numerous books, sometimes describing the secrets of their arts; the amount of necromancers in a particular world can be approximated quickly by examining the artifacts list in legends mode, which will list all slabs and books present after world generation. Necromancers who have a sufficient following may use their zombie slaves to build dark towers, a task that requires at least 50 followers; younger necromancers may take over towns or camps instead. Experienced necromancers may also take on apprentices, who will gain the skills of their masters.
Like other night creatures, necromancers do not need to eat, drink, or sleep; nor do they age. They have the power, within their line of sight (about 15 tiles), to raise corpses and any body parts and remains that are attached to, or were formerly attached to, muscles: mutilated corpses, partial skeletons, limbs, legs, even oyster shells, regardless of previous allegiances. They do so by gesturing; raising of the dead is reported as combat action in the combat log. Isolated they are harmless and carry no weapons, but the zombie servitors that protect them and that they raise are hostile to all life, and will be brought back again and again until the necromancer himself is killed, stunned, or knocked unconscious. Direct attacks on zombies in direct view of a necromancer is nigh suicidal; indirect combat is required.
Hostile necromancers caught outside with nothing to do will loiter in place and start campfires. They do not specifically path to corpses, but will move as any hostile unit will, towards the nearest friendly creature or nearest entryway. Therefore, it is possible to leach off their armies without them noticing or reviving their lost servants.
Necromancers can either be dwarven or human, and cannot be elf or goblin; and therefore need a lot of neutral land in world gen for them to appear. They also need a high number of available secrets (of life and death). An abundant amount of time for the secrets to be actually discovered during world generation is needed as well.
 Fortress mode
The dead walk. Hide while you still can!
Necromancers can lay siege to your fortress at any stage, including before the first migrant wave. They can do so if their tower or town is within 20 tiles of your fortress; as such, picking a location within such a distance of a tower is regarded as a sure way to have an extra helping of fun, and can be checked with during world gen. The sieges are structured much like normal sieges, except that the numbers tend to be much larger and much more disorganized, consisting not of individual squads but of masses of zombies coming from every side. The necromancer (or necromancers, if he has an apprentice) himself may or may not arrive with their siege; if they do, and are captured or killed, you can expect to see no more activity from that particular tower. Undead are hostile to everything that breathes as well as to enemy necromancer hordes, meaning that other sieges or ambushes (or, indeed, caravans) that happen to arrive when a necromancer siege is milling about will always result in a battle.
The easiest way to deal with a zombie siege is through the application of particle physics to grind them into nothingness. Anything that obliterates any trace of the zombie will prevent raising; a drop into magma or semi-molten rock or encasing in obsidian are more creative alternatives. The verdict is not yet out on whether slashing weapons are better or worse against necromancer sieges; although they tend to separate zombies into many parts, these parts can all be raised, leaving the question of whether the whole zombie or an arm here and a leg there are more dangerous. The undead that they will bring will be sapient creatures, but if you killed some elephants in a combat exercise and and they happen upon them, the danger is magnified.
If you have a vampire and haven't walled him in yet, you can draft him and take a leisurely walk through town, as undead will ignore him (unless attacked), and the necromancer is easy, valid game for a clobbering, if you can find him.
Necromancers can arrive under cover, alone, in ambushes, and raise the dead without being seen. This is much more difficult, as you cannot see the necromancers in question, only their products. Potential necromancer ambushes can be dealt with by internalizing all corpse/remains stockpiles behind heavily trafficked areas, and posting sentries if possible.
Necromancers can be made useful by applying them in training schemes. Necromancers trapped in a room with line of sight to, say, the contents of corpse stockpile can be used to generate an infinite amount of hostile creatures to fight; when you get tired of the sport (or your dwarves start getting beat up), simply block their line of sight with a bridge and put down the remaining enemies, and your military can walk out of training with more experience.
Capturing necromancers is simple: build a tunnel near them, link floodgates or bridges within so that it can be sealed off, and then poke a hole into the surface. Assuming the necromancer was the nearest creature to where you opened the tunnel, he'll be the first one in, and you can then seal off the tunnel and trap him inside. It's difficult to get them in there alone, without a few zombies following them, but it shouldn't matter. Cage traps will work too; caged necromancers can revive stuff, but you have to be very careful to make sure that there are no corpses anywhere near between where their cage is stored and where you are moving them. In v0.34, caged necromancers do not appear to revive stuff. You must put them on a restraint instead.
They can also be weaponized. Replace the militia training room with a room full of goblins, and fun will result. Upright spike traps can "kill" the corpses after each use so that the resulting goblinite can be gathered and the trap reused. Given enough time and enough bodies, such a trap can even best the circus.
Much like vampires, necromancers may seize control of a civilization and become its king/queen. In that case, the dwarf in question must be isolated from any corpses, as they may be friendly, but the zombies they tend to create will be of the dwarven-arm-ripping variety. They should be either isolated from the dead with a burrow, or applied to training/killing. Either way, they are very fun.
Necromancers may occasionally arrive with their slab in hand. These cannot be used to make your dwarves into necromancers, as creative water management can do for vampires, but it is nonetheless a good idea to stick it in a bin someplace safe, for use by a future adventurer once the fortress falls.
 Adventure Mode
In Adventure Mode, necromancers are most commonly found in towers (
I). The towers generally have a few necromancers and a lot of zombies. Becoming a necromancer yourself merely requires you to read about the secrets of life and death, which are either found on a slab or in a book. If you decide to attack the tower, it's suggested that you become a night creature by drinking a vampire's blood or being bitten by a werebeast, as zombies and other undead will not bother you if you are a night creature. Once you learn the secrets of necromancy, all remaining undead in the tower will no longer be hostile toward you, so simply making a mad dash for the slab may also be a viable tactic.
Also worthy of noting is that your adventurer will lose a substantial amount of their speed after about a week ingame time. You won't need to eat, drink or sleep anymore though.
 Tips and tricks
When attacking a tower without being undead, killing the necromancers before taking on the zombies is a good idea. Your best bet is to hit them with a ranged attack. If the necromancers turn out to be peaceful, simply lure the zombies outside (and out of visual range of the front door) one by one (or in groups) and eliminate them until you can successfully reach the slab or an appropriate book.
Another strategy, which may not always be available but can work well, is that you may sometimes find Vampires in the form of Warriors due to being given a quest to kill them. Instead of proceeding to kill them you can get these Warriors to join you instead. The Undead won't bother with them since they are Vampires and they won't bother with the Undead, but if there is a hostile necromancer in their view they will attempt to dispatch them like any other enemy, making it very safe for you.
You can reanimate corpses as many times as you want, by opening the misc. actions menu, selecting the Acquired Powers sub-menu, and choosing "Animate Corpse" ([x] - [p] - [->] - [enter]). Reanimated corpses hold potential usage as replenishable training tools for weapons and wrestling.
If you attack one of your own reanimated corpses, all of your reanimated companions will become neutral and will no longer follow you. This can be useful if you want to interact with civilized society - while a necromancer can still be friendly to mortals, its minions will attack everything in sight. This attack will cause the civilization to label you as an enemy for your undead minions' actions.