A quick survey of Mr. Whelan’s Russian social media contacts, about 70 in all, indicated that most seemed to be men with some sort of connection to academies run by the Russian Navy, the Defense Ministry or the Civil Aviation Authority. Most of those he reached out to said that Mr. Whelan seemed like a friendly, open American interested in learning the Russian language and culture and traveling around the country. Although he studied Russian, some of his social media contacts said he communicated through Google Translate.

One Russian whom Mr. Whelan started following on Instagram six years ago was Sergei Artyomenko, 26, a Moscow hair stylist who was then serving in the military. The two men never met in person, although they had a running joke about his getting a haircut, Mr. Artyomenko said. “I am not sure how he found me, but he would initiate small talk every six months or so,” Mr. Artyomenko said, adding that they had mostly discussed interesting places to travel.

Mr. Whelan’s family said that he was in Russia on his most recent trip, in December, to attend the wedding of a friend from the Marine Corps who was marrying a Russian woman at the storied Metropol Hotel in Moscow. That is where Russian authorities apprehended Mr. Whelan last Friday during a meeting with a Russian citizen in his hotel room.

Rosbalt, a Russian news agency close to the security services, quoted an unidentified intelligence source on Wednesday who said that Mr. Whelan was accused of trying to recruit the Russian to obtain classified information about staff members at various Russian agencies.

Mr. Whelan was arrested five minutes after receiving a U.S.B. stick containing a list of all of the employees at a classified security agency, Rosbalt said.

Despite the accusations, C.I.A. officers expressed skepticism that Mr. Whelan was a spy.

First, they said, the court-martial was the kind of black mark on his record that would most likely have prevented him from being hired by the C.I.A., or would at least complicate his tenure there. Most C.I.A. officers work in foreign countries while posing as diplomats, and if caught by a hostile government in an act of espionage, their diplomatic passports ensure they cannot be long detained, and at worst face expulsion.

Former C.I.A. officials who have operated in Moscow said the agency almost never sends officers into Russia without diplomatic protections. The United States, said John Sipher, a former C.I.A. officer who served in Moscow and ran the agency’s Russia operations, would “never leave a real intelligence officer vulnerable to arrest.”