SAN FRANCISCO — “I want to apologize,” the Facebook executive wrote last Friday in a note to staff. “I recognize this moment is a deeply painful one — internally and externally.”

The apology came from Joel Kaplan, Facebook’s vice president for global public policy. A day earlier, Mr. Kaplan had sat behind his friend, Judge Brett M. Kavanaugh, President Trump’s nominee for the Supreme Court, when the judge testified in Congress about allegations he had sexually assaulted Christine Blasey Ford in high school. Mr. Kaplan’s surprise appearance prompted anger and shock among many Facebook employees, some of whom said they took his action as a tacit show of support for Judge Kavanaugh — as if it were an endorsement from Facebook itself.

The unrest quickly spilled over onto Facebook’s internal message boards, where hundreds of workers have since posted about their concerns, according to current and former employees. To quell the hubbub, Facebook’s chief executive, Mark Zuckerberg, last Friday explained in a widely attended staff meeting that Mr. Kaplan was a close friend of Judge Kavanaugh’s and had broken no company rules, these people said.

Yet the disquiet within the company has not subsided. This week, Facebook employees kept flooding internal forums with comments about Mr. Kaplan’s appearance at the hearing. In a post on Wednesday, Andrew Bosworth, a Facebook executive, appeared to dismiss the concerns when he wrote to employees that “it is your responsibility to choose a path, not that of the company you work for.” Facebook plans to hold another staff meeting on Friday to contain the damage, said the current and former employees.