The only free and comprehensive online etymological dictionary of the Spanish language
hasta (Preposition) "until"

13th cent. Old Spanish fasta. From Arabic ḥattā 'id.'

Borrowing of prepositions is a rare phenomenon. Corriente (1983) argues the act of borrowing was influenced by the Latin phrase ad ista "to this." For the continued etymologies of these words, see a and éste respectively.