The Prophet married an underaged girl but kept her a virgin.
[66.5] Maybe, his Lord, if he divorce you, will give him in your place wives better than you, submissive, faithful, obedient, penitent, adorers, fasters, widows and virgins.
Most people don't notice Aisha is addressed as a "virgin".
Most women try to get married as a virgin but they are addressed as a wife afterwards, not a virgin.
In this Surah we find a narration about Hafsah bint Umar and Aisha bint Abu Bakr. (Widow and virgin respectively).
The prophet was already married to Aisha when Hafsah became a widow. Yet Aisha is addressed as virgin.
He hadn't had sex with her yet.
The reason he did marry an underage girl is because in the Quran his sexual laws are different to ours.
He has a Freedom.....
33.50
.... the Prophet desired to marry her-- specially for you, not for the (rest of) believers; We know what We have ordained for them concerning their wives and those whom their right hands possess in order that no blame may attach to you; and Allah is Forgiving, Merciful.
and importantly A RESTRICTION
33.52
It is not allowed to you to take women afterwards, nor that you should change them for other wives, though their beauty be pleasing to you, except what your right hand possesses and Allah is Watchful over all things.
I believe the Prophet married her and kept her a virgin till a decent age.