Intel Corp.'s  (INTC) - Get Report  CEO is out. 

Brian Krzanich resigned on Thursday, June 21 after it was revealed that he had a previous consensual relationship with an Intel employee. The company has a non-fraternization policy in place.

"Intel was recently informed that Mr. Krzanich had a past consensual relationship with an Intel employee," the company wrote in a press release. "An ongoing investigation by internal and external counsel has confirmed a violation of Intel's non-fraternization policy, which applies to all managers. Given the expectation that all employees will respect Intel's values and adhere to the company's code of conduct, the Board has accepted Mr. Krzanich's resignation." 

Intel named Robert Swan, CFO, as the interim CEO. Swan has been an executive vice president and Intel's CFO since October 2016; previously he was general partner at private equity and VC firm General Atlantic and CFO of Ebay Inc. (EBAY) - Get Report for nine years.

"The Board believes strongly in Intel's strategy and we are confident in Bob Swan's ability to lead the company as we conduct a robust search for our next CEO. Bob has been instrumental to the development and execution of Intel's strategy, and we know the company will continue to smoothly execute. We appreciate Brian's many contributions to Intel," said Andy Bryant, Intel Chairman.

Krzanich first became Intel's CEO in 2013 after having served as chief operating officer. He started his career there as an engineer in 1982 right after graduating from college.

In its press release, Intel also announced that it expects to see second quarter revenues of $16.9 billion. Its second quarter results will be released on July 29.

In morning trading, Intel was down 1.2% to $52.79 after initially rising close to 2%. Year to date, shares are up about 14%, compared to the Nasdaq's 13% rise over the same time period.