Something similar happens in Turkish occupied Cyprus.
The Turkish airport in Turkish Cyprus is not recognized by Greek Cypiriot government, so if you do fly from Turkey to Cyprus, it is not considered a valid port of entry.
Thus you will get a stamp on a piece of paper, which you need to leave the country back to Turkey.
When traveling between the Turkish and Greek side of the island, the checkpoint guards will inspect your passport. As Greek Cyprus is part of the EU, EU laws require all EU Memberstates to allow free travel for any EU citizen. Likewise, due to agreements between the US, Cyprus and the EU, US citizens are too allowed free-travel. Citizens from other countries run the risk of being denied entry.