Staphylinus olens trick-or-treating by the back door earlier today (rare sight, as they're nocturnal).
The
'net says:-
At the end of its abdomen are a pair of white glands which can emit a foul smell. It can also squirt a stinking brown fluid from its mouth and anus.
The 'devil's coach-horse' name came from Irish mythology where this particular beetle was considered [a] symbol of corruption. It was believed to have the power to kill on sight, and that it would eat sinners. When the beetle raised its tail, it was thought to be casting a curse. The foul smelling fluid emitted added to the effect.