Back in 1994, after the breakup of the Soviet Union, Ukraine became the third largest nuclear power. That was due to the fact that the Soviet Union stationed nukes there. To disarm the country, Ukraine, Great Britain, Russia and the United States entered into an agreement called "The Budapest Memorandum." The deal worked this way. Ukraine would give up its nukes to Russia in exchange that its existing borders would be respected by Russia. That includes the Crimea Peninsula.
So today's Crimean referendum and the all but certain annexation by Russia violates international law. One could argue that the law was broken when Russian troops invaded Crimea weeks ago. By the way, the whole referendum was a sham anyway. The current Crimean legislature was put in place to put this referendum up. You see the old one was dismissed. (BBC Report) Plus, an elector could not vote no to joining Russia and stay in the Ukraine.