How did Azerbaijan and Armenia end up with such messy de jure and de facto borders?

by The_Manchurian

Nagorno-Karabakh (Armenian-controlled, in Azerbaijan) and the Nakhicheven Autonomous Republic (part of Azerbaijan, but on the other side of Armenia).

voyeur324

/u/avedji has previously answered Why do Azerbaijan and Armenia each have enclave territories inside each other?

More answers are pending all over the subreddit. Maybe today is the day this thread is blessed with a more detailed response than I can provide.