While the details behind the release of the final two Americans held in North Korea — Matthew Miller of Bakersfield, California, and Kenneth Bae of Lynnwood, Washington — are still unclear, here are questions and some answers as to what might have motivated the North to let the two men out.

Q: WHAT DOES NORTH KOREA GET OUT OF IT?

A: Pyongyang apparently got at least one thing it wanted: A senior U.S. official had to come personally to retrieve the two Americans. James Clapper, the director of national intelligence, was the highest-ranking American to visit Pyongyang in more than a decade.

It was not immediately clear if Clapper held any talks with North Korean officials while he was in Pyongyang. A senior administration official said Clapper carried a brief message from President Barack Obama indicating that he was Obama's personal envoy to bring the two Americans home.

Clapper's visit in itself is something of a coup for Pyongyang, which has for months been pursuing a high-profile campaign to keep the detainees' situation on Washington's radar.

As part of that effort, the North had allowed the men, along with a third detainee, Jeffrey Fowle, who was released last month, to meet with The Associated Press and other media. The AP met with Fowle and Miller three times. Each time, they pleaded for a senior U.S. statesman to come and bail them out.

That has been the pattern in past releases. Previously, trips have been made by former Presidents Jimmy Carter and Bill Clinton.

Pyongyang tends to look on such visits as stature-boosting evidence that is tantamount to an official apology — though U.S. Secretary of State John Kerry recently said Washington had no intention of offering any official apology to Pyongyang as a quid pro quo.

Q: WHY NOW?

A: There is a growing concern in North Korea over international pressure in connection with its human rights record. A recent U.N. report documented rape, torture, executions and forced labor in the North's network of prison camps, accusing the government of "widespread, systematic and gross" human rights violations.

North Korea strongly denies those allegations, which it claims are based mainly on politically motivated statements from defectors. It released a counter document of its own in September, but is worried about efforts to bring the issue before the International Criminal Court.

Its state media has recently been filled with angry accusations that the United States, South Korea and their allies are trying to use the human rights issue as a weapon to bring down the North Korean government, calling it a "racket" and pointing out problems with the United States' own human rights record.

Pyongyang has portrayed similar releases of American detainees in the past as humanitarian decisions and its likely portrayal of the release this time in the same manner could point to that as an important motive behind the decision.

Q: HOW DID THE AMERICANS END UP IN NORTH KOREAN PRISON?

A: Bae had been held since November 2012, when he was detained while leading a tour group in a special North Korean economic zone. He was convicted of conducting "hostile acts" after being accused of smuggling in inflammatory literature and trying to establish a base for anti-government activities at a border city hotel.

Bae, who is 46, is a Korean-American missionary and his family believes he was detained because of his Christian faith.

Miller's case remains mysterious.

He entered the country on April 10 on a tourist visa, allegedly ripped up the document at Pyongyang's airport and demanded asylum. North Korean authorities say he intended to conduct espionage while in the country. During his brief trial, North Korean prosecutors said he admitted having the "wild ambition" of experiencing prison life so that he could secretly investigate North Korea's human rights situation.

___

Eric Talmadge is the AP's Pyongyang bureau chief.

Follow him on Twitter at https://twitter.com/EricTalmadge