It was given to the Ukraine by Russia about 60 years ago but at the time Ukraine was part of USSR so it didn’t matter.
I read one report that supposedly Khrushchev was drunk when he decided to give Crimea to Ukraine.