Overstock.com's CEO resigned on Thursday weeks after he admitted to having a relationship with a Russian agent and being involved in an FBI probe.

The company's stock prices surged 5 percent after Patrick Byrne resigned following his claim of being involved in a Federal Bureau of Investigation probe into Russia and former U.S. presidential candidate Hillary Clinton.

His resignation follows a drop of over 30 percent in the online retailer's shares over two days earlier this month, with investors rattled after Byrne claimed in a statement that he had secretly been involved with the FBI since 2015.

The stock briefly surged 15 percent after the announcement of Byrne's resignation.

Overstock.com CEO Patrick Byrne, (pictured), resigned weeks after he admitted to having a relationship with Russian agent Maria Butina, (right), and being involved in an FBI probe

The company's stock prices surged 5% after Patrick Byrne resigned following his claim of being involved in a Federal Bureau of Investigation probe into Russia and Hillary Clinton

'While I believe that I did what was necessary for the good of the country, for the good of the firm, I am in the sad position of having to sever ties with Overstock, both as CEO and board member,' Byrne said in a resignation letter addressed to shareholders on Thursday.

'It has been an honor to serve you through thick and thin, threats grand and arcane, for the past 20 years.'

In a letter to investors on August, 11, Byrne confirmed that he had a personal relationship with Maria Butina, a convicted Russian agent currently serving jail time in a US prison.

In Byrne's August 11 letter, which referred to the 'deep state,' he said that starting in 2015 he assisted federal law enforcement officials, whom he called 'the Men in Black.'

He said he was involved in probes 'about political espionage conducted against Hillary Clinton and Donald Trump'.

During their relationship, he said Butina asked about meeting or seeking to meet people involved in the campaigns of Hillary Clinton, President Trump and others.

He said that concerned him and he later began communicating with the FBI about his interactions with her.

Maria Butina admitted covertly gathering intelligence on the National Rifle Association and other groups at the direction of a former Russian lawmaker.

She pleaded guilty to a charge of conspiracy to act as an unregistered foreign agent and was sentenced in April to serve 18 months behind bars in May. The 30-year-old has been jailed since her arrest in July.

Butina admitted that she had worked with former Russian lawmaker Alexander Torshin to use their contacts in the NRA to pursue back channels to American conservatives during the 2016 presidential campaign.

She violated US law because she did not report her activities to the US government.

The company's stock prices surged 5% after Patrick Byrne resigned his position on Thursday

As part of her plea agreement, Butina acknowledged she 'sought to establish unofficial lines of communication with Americans having power and influence over US politics'.

In an interview with The New York Times, Byrne said he was still 'quite fond' of Ms. Butina,'

He added: 'Maria should go home and be president of Russia one day. That is the best thing that could happen to Russia and the US.'

In a statement last week, Byrne claimed his communications with investigators had been 'less about law enforcement and more about political espionage conducted against Hillary Clinton and Donald Trump'.

In an interview with Fox Business, Byrne claimed: 'We are about to see the biggest scandal in American history.'

A libertarian with a doctorate in philosophy from Stanford University, Byrne for over a decade has publicly battled short sellers targeting his company as it competes against larger rivals, including Amazon.com Inc and eBay Inc. He is known for making brash and freewheeling comments.

Overstock said it appointed company veteran Jonathan Johnson, (pictured), as interim CEO

Maria Butina pleaded guilty to a charge of conspiracy to act as an unregistered foreign agent and was sentenced in April to serve 18 months behind bars in May

On Thursday, he lauded the remaining Overstock executive team with pop culture references, calling the chief marketing officer 'Commander Data,' after a Star Trek character.

He said another executive called an artificial intelligence system 'Skynet,' after the Terminator movie series.

In a separate statement, Overstock said it appointed company veteran Jonathan Johnson as interim CEO.

Overstock is currently more targeted by short sellers than 99 percent of US companies, according to Refinitiv.

Total short bets against Overstock stand at $267 million, equivalent to almost 50 percent of its float, according to S3 Partners, a financial analytics firm.

Byrne is also a vocal proponent of blockchain technology and cryptocurrency.

In May, he lashed out at investors who questioned the motivation behind his sale of about 15 percent of his Overstock shares, saying he had to supplement his $100,000 a year salary and vowing never to 'give such an explanation again.'

The stock has fallen more than 70 percent from record highs in January 2018, when Overstock was benefiting from Byrne's plan to launch a digital token, and from hype around Bitcoin.

'On any normal day, my presence is not conducive to strategic discussions regarding our retail business. I believe that going forward my presence will definitely not be conducive to such strategic discussions,' Byrne wrote in his resignation letter.