Patrick Byrne resigned as chief executive of online retailer on Thursday, saying in a letter to shareholders that he had no choice but to quit as a result of the attention stirred up by his decision to publicly disclose his relationship with a woman accused of being a Russian agent.

Byrne said in his letter that his continued presence at Overstock’s helm “may affect and complicate all manner of business relationships.”

“Thus, while I believe that I did what was necessary for the good of the country, for the good of the firm,” he wrote, “I am in the sad position of having to sever ties with Overstock, both as CEO and board member.”

Byrne’s relationship with the woman, Maria Butina, lasted three years, from 2015 to 2018, and eventually became romantic. It did not become widely known until last week, when Overstock took the unusual step of issuing a news release calling attention to it.

In that release, which was a response to a report that Byrne had been involved in the federal inquiry into the 2016 presidential election, he said that he had been helping law-enforcement agents, whom he referred to as “Men in Black,” with their “Clinton Investigation” and “Russia Investigation.”

Butina sentenced to 18 months as Kremlin agent

Butina is serving an 18-month prison term after being accused by federal prosecutors of trying to infiltrate powerful political circles in the United States at the direction of the Russian government. She ultimately pleaded guilty to a lesser charge.

In a separate news release Thursday, Overstock said that Jonathan E. Johnson III had been named interim chief executive. The company’s shares were up more than 10% on Thursday after Byrne announced his resignation.