My PCs (levels 19-20) are really afraid of clerics (it's somewhat justified from their previous encounters) and usually try to focus all their actions in the first round to get rid of one, no matter what other opponents there are.
I've been preparing an arena-like encounter with one of the opponents being a ~23rd level evil cleric. He'll be somewhat ready for spells, but the main issue is Dimension Door-ing the fighter and the dual wielding rogue, who can easily deal 200-250hp damage in a single round.
Of course, it's possible the cleric will win the initiative or the PCs go for buffing themselves instead, but keeping the cleric alive until the second round is still my main concern.
We play D&D 3.5 using mostly the SRD, especially for hostile NPCs (with minor exceptions, like in this case the Danger Sense feat from the Complete Adventurer, which allows to reroll initiative 1/day).
So far, my best bet is Miracle as Contingency triggering Heal at certain HP threshold. Because of an expected Greater Dispel Magic I'd prefer him to be better protected. Evil ideas wholeheartedly welcome!
Some specifics:
Human, main focus on WIS, CHA and DEX
Domains: Evil and Trickery
Magic items: up to 150,000 gp EDIT: this is after considering all the other magic items he already has, that are not relevant to melee or have been necessary for the plot earlier
No custom epic spells or custom Miracle-based effects (Miracle mimicking other spells is ok)
Spells and magic items from the SRD only
Before the encounter he can only cast spells with duration of at least 10 min/level
He should be able to normally walk and talk before the encounter
About the encounter:
To simplify things: the PCs and the cleric argue in front of a king, and upon losing the argument, the cleric demands trial by combat. He did anticipate that, while the PCs couldn't (it's a very foreign land and it's not really a typical trial by combat).
The king orders the combat right away, in front of him in the throne room. His construct-guards create the arena - 50 feet in diameter, surrounded by a wall of force.
The cleric has no prior access to the throne room and could not anticipate the exact time of the duel, however he could know which part of the throne room is usually used for this purpose.
Exceptions to the SRD:
Feats unrelated to spellcasting
Skills and skill tricks
I could consider prestige classes
Monsters
One more edit: I have pretty solid tactics for the cleric starting from round one, based on a lot of scouting he did about the PCs. Any suggestions are obviously welcome, but the focus is to make sure the cleric can start his actions at all.