In reply to Timmd:
> (In reply to JuneBob)
>
> My intuitive answer is it's to remove a bit of foreign matter from the skin before it does something bad, like cause an infection or work it's way into the skin as the skin continues to grow around it, which could be very bad. I guess that applies to bacteria and bites and old skin too. It's a way of keeping the skin clear of things which shouldn't be on it.
>
That's pretty much it - histamine is involved in initiating local inflammatory immune response. Amongst other things it makes your capillaries more permeable to the white blood cells and proteins involved in immune responses so that they can migrate into the area where the foreign substance is to deal with it. It is an important primary immune response at all mucosal surfaces, not just the skin.
The bad news is that scratching will make bites worse because it increases localised inflammation which means that your body thinks it needs more white cells in the area and produces more histamine.
The good news is that a normal antihistamine tablet, like you would take for hayfever, will make the worst of the itching go away.
As an aside, histamine also functions as a neurotransmitter with effects on sleep regulation. This is why older hayfever tablets used to make you drowsy. Modern tablets are more specific in which of the four histamine receptors they block and therefore don't have this problem any more.