"I give it to him who came first" vs. "to he who came first" [duplicate]

Possible Duplicate:
Which is grammatically correct: “Let he who…” or “Let him who…”

Should the pronoun be "him" because it's the object (gave it to him), or should it be "he" because it is subject of the subordinate clause "he who came closest."

Also, what is "who came first" described as, grammatically?

I should know, but I don't, and it bugs me.


Solution 1:

The correct pronoun is him, because it is first and foremost the indirect object of the main clause (I gave it to him), and should therefore be in the accusative.

It's actually not the case that him is the subject of the relative clause (who came first). The subject of that clause is who.