MOSCOW — Ukraine's president has signed a bill threatening any Russian flying into Russia-annexed Crimea with a stint in prison.

Ukrainian border guards control the land crossing into Crimea, which was annexed by Russia in 2014. But most travelers prefer to fly to the peninsula directly from Russia, which regards the trip as domestic travel. Ukraine deems such flights illegal crossings of the Ukrainian border.

The Ukrainian parliament said Wednesday that the president signed a bill making such crossings a criminal offense punishable by up to three years in prison. The law will apply to Russian nationals or anyone acting in Russia's interests.

The new legislation means that any Russian who flies into Crimea or drives there via a new bridge linking it with Russia's mainland will face criminal charges in Ukraine.