A federal indictment made public Wednesday charged the man, Mohamed Tahlil Mohamed, 38, with kidnapping, hostage taking, conspiracy and other counts. The authorities have not said where he was arrested or how he came to the United States.

The indictment identified his hostage only as “John Doe,” but Mr. Moore confirmed on Thursday that he was the unnamed victim.

When asked about the arrest of Mr. Tahlil, Mr. Moore replied, “I’m not as happy as you might imagine that he’s in jail.” He declined to comment further and would not say whether the Facebook exchanges had in some way led to Mr. Tahlil’s capture or surrender.

Heavily armed men abducted Mr. Moore when he was doing research on piracy in January 2012 near the inland town of Galkayo, about 400 miles northeast of the capital Mogadishu. Mr. Moore’s book “The Desert and The Sea: 977 Days Captive on the Somali Pirate Coast,” published in July, recounted his ordeal.

It appears from the Facebook exchanges — some of which are detailed in a criminal complaint and others in Mr. Moore’s book — that the journalist developed a kind of affinity for Mr. Tahlil, who, in turn, provided Mr. Moore with information about his kidnappers.