A Facebook executive apologized at a company-wide meeting on Friday for his unexpected appearance at a hearing for Supreme Court nominee Brett Kavanaugh, according to sources at the company who were not authorized to speak publicly.

Joel Kaplan, Facebook's vice president of global public policy, said it was a mistake for him to have attended the hearing without consulting other executives, the sources said.

Facebook held the all-hands meeting after Kaplan's appearance drew public attention and led to some employees protesting in emails and on internal message boards. CEO Mark Zuckerberg initially defended Kaplan's decision.

A spokesperson for Facebook declined to comment.

Kaplan, a longtime friend of Kavanaugh, was spotted in the second row of the hearing in which the nominee strenuously denied allegations of sexual assault.

Though Kaplan attended in a personal capacity, some within Facebook felt it appeared as if the company was standing behind Kavanaugh. Kaplan did not discuss his appearance with anyone at Facebook before the hearing, which he apologized for at Friday's meeting.

Zuckerberg and Chief Operating Officer Sheryl Sandberg both attended the meeting and expressed frustration that Kaplan had inserted the company into the political moment, the sources said. They also unequivocally condemned sexual assault and said that Facebook should be a place where diverse points of view are tolerated and supported.

The controversy adds to growing political tension around Facebook. Tech companies that have spent years avoiding politics are now dealing with accusations of bias from liberals and conservatives. Facebook has sought to assure politicians, media partners and the general public that it does not favor either party, though Zuckerberg has come out in support of liberal immigration policies.