Politicians and Hollywood actors aren’t the only ones who get caught in sex scandals. Turns out, the technorati aren’t immune to it either.

Chief Operating Officer Keith Rabois resigned from his position at mobile payment processing company Square after being accused of sexual harassment. New York attorney Steven Berger contacted the company a couple of weeks ago claiming that executive had sexually harassed Berger’s client, a Square employee, and that the company knew about it and failed to respond appropriately.

This kind of thing happens all the time, but it’s usually dealt with behind closed doors. What’s unique this time is that it’s playing out very publicly, in part because Rabois did what few people in his position would do — he explained his side of the story online.

According to a post on his personal blog, the relationship began prior to the employee’s hire at Square. In fact, it was at Rabois’ urging that the unnamed “friend” applied. The former COO says he had very little to do with that employee’s work or career there, and contrary to the accusations, he maintains that the company had no knowledge of the relationship. While it shows poor judgment that the executive officer didn’t disclose this at the time, Rabois insists it was completely consensual.

“I deeply regret that I let my personal and professional lives become intertwined, and I apologize to my colleagues and friends (at Square and elsewhere) who I’ve let down, and who will bear the brunt of some of the unnecessary, negative attention this situation will likely bring,” writes Rabois.

Ultimately, instead of fighting the allegations, Rabois left the company on Thursday, in a move that surprised the business and tech world. He writes, “I decided to resign from Square so my colleagues could continue to do great work without the distraction that a lawsuit would most certainly bring.” His resignation may have headed off legal action, as the Wall Street Journal reports that no actual case has been filed.

Now, there are two sides to every story, so it’s hard to take this account as the whole truth. And if he’s guilty of sexually harassing an employee, then this hit to his reputation is well-deserved. But if Rabois is, as he puts it, the victim of an attempted “shakedown,” then it’s hard not to empathize with a man who fell on his sword to spare his company. Whether that was actually the case or not, however, may never be known.

Rabois was a high profile tech exec, with a resumé that includes well-known players like PayPal and LinkedIn. While legendary co-founder Jack Dorsey (he, of Twitter fame) may have focused on product design at Square, it was Rabois who handled business-critical strategy in marketing and business development. Since his start at the company in 2010, he helped grow the operation from 17 employees to 400+.

Before this episode, most recent headlines about Square had been immensely positive. In fact, it has been on fire lately. Last year, it raised $200 million in financing and scored an extremely high-profile partner in Starbucks, which will use its device and software for mobile payment processing in 7,000 of its locations.