The landmark prisoner swap Russia, the United States and several of its allies agreed to that brought home journalist Evan Gershkovich and former marine Paul Whelan and freed 14 others was more than two years in the making.

It involved secret talks and complex diplomacy involving Germany, Russia and the U.S., which all had divergent interests.

And it nearly didn't happen.