(Reuters) - U.S. spy chief James Clapper said that when he made a secret visit to North Korea in November to bring home two jailed Americans he was first given a 12-course banquet and then later told by his hosts that his security could not be guaranteed.

Clapper gave details of his trip, made at the behest of President Barack Obama, for the first time during a forum on Monday at the Council on Foreign relations.

He said that after his arrival in the isolated country's capital, a North Korean four-star general hosted what Clapper called a "marvelous" 12-course meal at a restaurant above a bowling alley.

The next day, Clapper said, a representative of the state security ministry came to his guest house and told him the government no longer considered him a presidential envoy and could not guarantee his security and that of his party.  

Clapper said they packed their bags and were taken to a room at a Pyongyang hotel where a delegation of Korean officials, led by state prosecutors, was waiting with the Americans, Kenneth Bae and Matthew Miller, who were still dressed in prison uniforms.

After a denunciation of the prisoners was read out, the officials walked out of the room, leaving the Americans in the company of Clapper and his aides. The freed Americans changed clothes, and the party headed for the airport for a flight home.

Bae and Miller returned to a warm welcome in the United States on Nov. 8.

Bae, 46, a Korean-American missionary from Lynnwood north of Seattle, was arrested inNorth Korea in November 2012 and sentenced to 15 years' hard labor for crimes against the state. Miller, in his mid-20s, was reportedly convicted on an espionage charge and in custody since last April, serving a six-year hard labor sentence.

North Korea is under tough international sanctions for its nuclear and missile programs and was severely criticized for its human rights abuses in a United Nations report last year.