WASHINGTON — Roger J. Stone Jr., an off-and-on adviser to President Trump for decades, has acknowledged that he had contact on Twitter with Guccifer 2.0, the mysterious online figure that is believed to be a front for Russian intelligence officials.

It is the first time that someone associated with Mr. Trump has confirmed any type of contact with Guccifer 2.0, which claimed to be a Romanian hacker and took credit for the hacking of the Democratic National Committee.

But Mr. Stone insisted in an interview that the contact had been brief and involved nothing more than the exchange of a few direct messages, well after the party committee had been hacked. “Even if he is a Russian agent, my cursory exchange with him happens after he releases the D.N.C. stuff,” Mr. Stone said on Saturday. “There’s only one exchange with him. I had no further exchanges.”

Mr. Stone said the exchange took place after he had published an article on Aug. 5 on the Breitbart News site about the hacking, which the American government has tied to a Russian effort to meddle in the election. After Guccifer 2.0 had been suspended by Twitter, Mr. Stone posted a message against “censorship,” and he later had what he called an “innocuous” exchange over direct message.