NEW YORK (AP) — Intel CEO Brian Krzanich has resigned after the company learned of what it called a consensual relationship with an employee.

Intel said Thursday that the relationship was in violation of the company’s non-fraternization policy, which applies to all managers.

Chief Financial Officer Robert Swan will take over as interim CEO immediately. A search for a new CEO is underway.

In this #MeToo era, corporate America is under intense pressure to enforce workplace policies on gender equality and sexual harassment.

Earlier this month, Guess Inc. co-founder Paul Marciano stepped down following a company investigation into allegations of sexual harassment and assault.

John Lasseter, co-founder of Pixar Animation Studios and Walt Disney’s animation chief, also recently said he was resigning over what he called “missteps” with employees.

Krzanich joined Intel Corp. in 1982 as an engineer.

The abrupt departure of Krzanich, who has been the Intel’s top executive since 2013, overshadowed otherwise positive news for the $246 billion tech company.

Intel said Thursday that it expects to post a per-share profit of 99 cents in the second quarter, 13 cents better than Wall Street was expecting, and revenue of $16.9 billion, which is also better than had been projected by industry analysts.

Shares of Intel Corp., based in Santa Clara, California, slid 2 percent in early trading.

(© Copyright 2018 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)