WASHINGTON – It began with a friendly tap on the shoulder and a rare show of bipartisanship.

By the time it ended Friday afternoon, Brett Kavanaugh had won a hard-earned stamp of approval from the Senate Judiciary Committee but faced a likely FBI investigation into a 36-year-old accusation of sexual assault.

The driving force behind the compromise was Sen. Jeff Flake, the retiring Arizona Republican who has become a thorn in President Trump's side. Flake had been cornered in an elevator by two sexual assault survivors as he headed to the committee meeting.

"You're telling me that my assault doesn't matter," one woman said, her remarks captured by TV cameras.

More:Protester shouts at Sen. Jeff Flake in elevator: ‘Tell me it doesn’t matter’

More:Judiciary Committee Democrats walk out of Kavanaugh hearing in protest

A clearly conflicted Flake had put out a simple, four-paragraph press release Friday morning – shortly before the elevator encounter – announcing his long-anticipated support for Kavanaugh's ascension to the Supreme Court. The announcement was a major boost for the 53-year-old federal appeals court judge, but it was to be short-lived.

Flake later told reporters it wasn't a single moment that influenced him, but he was clearly shaken after the elevator encounter. He said he had already spent the week hearing from people "emboldened" to come forward with their stories of sexual assault.

"I’ve heard from friends, close friends. I had no idea," Flake said. Already torn, he watched Ford and Kavanaugh testify Thursday, then endured a sleepless night.

As most of the committee's 21 members droned on for hours about the Kavanaugh nomination, Flake looked troubled. He left the room frequently. And after Democratic Sen. Christopher Coons of Delaware finished speaking about the need for an FBI investigation, Flake moved from the Republican to the Democratic side of the dais and tapped his friend on the shoulder.

“It’s about the court’s legitimacy,” Coons had just said. If Kavanaugh is confirmed without a fuller investigation, "his service may well have an asterisk. Litigants coming to the court will have reason to question the fairness of the institution.”

More:Trump calls Ford's testimony 'compelling,' leaves door open for FBI probe of Kavanaugh

More:Senate panel advances Brett Kavanaugh's nomination, calls for FBI probe may come before final Senate vote

The Flake-Coons tête-à-tête set off a flurry of conversations outside the room as senators continued to deliver remarks inside, a clear sign something was up.

Following Flake and Coons into a side room were Sens. Patrick Leahy, D-Vt., and Amy Klobuchar, D-Minn. Others continued to go back and forth. Sen. Sheldon Whitehouse, D-R.I., suggested to committee Chairman Chuck Grassley, R-Iowa, that the scheduled 1:30 p.m. EDT vote be delayed.

“At some point, virtually every member of the committee … was in the back hall,’’ Coons said. He acknowledged there were "very sharp conversations’’ about “some of the partisanship and some of the posturing.”

As the clocked ticked toward 2 p.m., the negotiators emerged with a deal. Flake voted with his party to advance Kavanaugh's nomination by an 11-10 vote. But he asked that the FBI be given up to a week to investigate Christine Blasey Ford's claim that in 1982, Kavanaugh assaulted her at a suburban Maryland house party.

“The country’s being ripped apart here,” Flake said. “We can have a short pause and make sure that the FBI can investigate.”

Democrats were ebullient, even though they lost the vote. “It’s better than where we were before, let’s just leave it at that,” Klobuchar said.

Flake acknowledged an FBI investigation probably won't "change votes in the end," but he predicted it would make many senators "feel better about the process."

Republicans were despondent, realizing that further delay could lead to more charges against Kavanaugh.

Sen. John Cornyn, R-Texas, acknowledged that Flake "maintains considerable leverage." The Arizona senator and two other Republicans, Sens. Susan Collins of Maine and Lisa Murkowski of Alaska, hold Kavanaugh's fate in their hands.

As Grassley adjourned the panel, there was confusion about what they had just voted on. Was a second vote necessary on the FBI investigation?

“What?” Sen. Dianne Feinstein, D-Calif., could be heard asking on an open microphone. “Did you cut off a vote?”

"This is all a gentlemen's and women's agreement," Grassley said. But within hours, it was turned into a formal committee statement:

"The Senate Judiciary Committee will request that the administration instruct the FBI to conduct a supplemental FBI background investigation with respect to the nomination of Judge Brett Kavanaugh to be an associate justice on the Supreme Court.

"The supplemental FBI background investigation would be limited to current credible allegations against the nominee and must be completed no later than one week from today."

Grassley and other Republicans headed to the Capitol to discuss how to proceed. In the heat of the moment, many of them had gotten extra protection. Grassley was escorted by at least six Capitol Police officers as he dashed by reporters.

Coons told reporters he and Flake couldn’t be further apart on many issues, but he choked up in relating what they have in common.

"But we share a deep concern for the health of this institution, and what it means to the rest of the world and our country if we are unable to conduct ourselves respectfully and in a way that hears each other," Coons said.

There was still one more thing to do before Flake and Coons could call it mission accomplished.

"Someone's got to explain this to Trump," Sen. Lindsey Graham, R-S.C., told reporters outside the hearing room. At the time, the president was meeting with President Sebastián Piñera of Chile.

Asked to explain it himself, Graham offered three simple words:

"This is democracy."

Contributing: Deborah Berry and Herb Jackson

More: Yale Law joins American Bar Association inrequest for FBI probe

More: Prosecutor who questioned Ford says she wouldn't prosecute Brett Kavanaugh