Sen. Cory Booker, shown here on Capitol Hill on Oct. 17, appeared as a character witness for Sen. Robert Menendez, a fellow New Jersey Democrat. (Reynold/Epa-Efe/Rex/Shutterstock/Reynold/Epa-Efe/Rex/Shutterstock)

Sen. Robert Menendez's defense team drew high-profile witnesses from both sides of the aisle Thursday to praise the New Jersey Democrat's character — but sparks flew after the judge ruled the defense couldn't also elicit testimony from a well-
connected lawyer.

The eight-week-old public corruption trial of Menendez and his co-defendant, Florida eye doctor Salomon Melgen, has been a somewhat dry affair, focusing on the details of flight records, ­Caribbean port contracts and Medicare billing policies.

That changed Thursday when Sens. Lindsey O. Graham (R-S.C.) and Cory Booker (D-N.J.) took the stand.

The defense had also planned to call Marc E. Elias, the attorney who commissioned the now-
famous dossier containing allegations about President Trump's connections to Russia and possible coordination between his campaign and the Kremlin.

Elias, who has represented Hillary Clinton's presidential campaign and many Democrats, was expected to discuss the practice of filling out Senate financial disclosure forms. Omissions on such forms are the basis for three of the charges against Menendez.

But the trial judge, William Walls, said Thursday he would not allow Elias to testify, leading to a contentious exchange with the defense lawyers, who asked him to declare a mistrial.

"You let the government tell their side of the story, and then we're not allowed to tell our side," Melgen attorney Kirk Ogrosky told Walls. "That's the issue in a nutshell."

Unimpressed by that argument, Walls said the trial would continue.

"All of you are out of your legal Pampers, and I'm not bailing you out unless it's a case of rank injustice," he said.

Walls showed little patience for the allegation, cutting off Ogrosky and Menendez attorney Abbe Lowell several times during their arguments.

Sen. Lindsey O. Graham (R-S.C.) was the first Republican to testify on behalf of Menendez. (Thew/Epa-Efe/Rex/Shutterstock/Thew/Epa-Efe/Rex/Shutterstock)

"I sometimes feel like I can't finish a sentence without you interrupting," Lowell told the judge. The defense attorneys said they would file additional written arguments on the issue.

Menendez is facing bribery charges, accused of taking gifts from Melgen that included trips on a private jet, a stay at a Paris hotel and campaign donations. In exchange, prosecutors allege, Menendez sought to help Melgen on several fronts, from getting visas for the doctor's girlfriends to trying to resolve a multi­million-dollar billing dispute with the U.S. government.

Menendez and Melgen say that they are longtime friends who enjoyed spending time together and that they were motivated by that friendship, not corruption.

Graham testified that he has known Menendez since their days in the House of Representatives and later worked with him as part of "the Gang of Eight," a bipartisan group of senators who tried to come up with comprehensive immigration reform. The two often eat breakfast together in the Senate dining room, Graham said.

Citing the Iran nuclear agreement, which Menendez opposed, Graham called Menendez someone Republicans can go to if they're looking for bipartisan support. Graham said that he and Menendez don't often agree on issues but that the New Jersey Democrat is a man of high character.

"In very difficult circumstances, he always keeps his word," Graham said. "A handshake is all you need from Bob. He's a very honest and trustworthy senator."

Prosecutor Peter Koski asked Graham if he had been in the courtroom the past eight weeks for the testimony of other witnesses. Graham replied that he had not, a response that Booker also gave later.

Booker, the former mayor of Newark, was effusive in his praise of Menendez and his efforts to fight for people of the inner city.

Booker joked that when he first got to the Senate in 2013, Menendez helped show him the ropes. Unsure of whether he needed to push a button or pull a lever to cast a Senate vote, Menendez told him he simply needed to say, "Aye."

Since that time, their relationship has grown and flourished, Booker said.

He described Menendez as "profoundly honorable" and "trustworthy," and a politician who understands from experience the struggles of working-class people.

"Bob and I are in the thick of it together," Booker said. "We're partners. We're in the struggle together. I don't just observe him, I work with him."

Menendez is someone who "when he gives you his word, you can take it to the bank," Booker said.

As character witnesses go, Booker could have cachet for the jurors. He was the mayor of Newark, where the federal trial is being held, for about eight years before winning his Senate seat, and he is the first African American elected to statewide office in New Jersey.

The two sitting senators are the most powerful players deployed in the defense strategy of rebutting the charges by presenting Menendez as an honorable, honest person — even if those witnesses don't have anything to say about the facts of the case.

Booker, a potential 2020 presidential aspirant, has been close to Menendez since winning his Senate seat four years ago and has remained steadfastly supportive of the indicted senator despite the trial.

"My loyalty is to a guy that is fighting the good fight," Booker told The Washington Post on Wednesday.

"My focus is supporting him as a guy that's trying to put up a strong defense," he added.

Booker has already made high-profile appearances in the courtroom, including on the first day of the trial, when he was there as a guest and hugged Menendez.

Menendez spoke to reporters after the court session ended and thanked Graham and Booker for testifying about "who I really am."

He said he was disappointed that it reached a point where his attorneys had to make a mistrial motion and said they would carry on with their defense.

Elias, of the firm Perkins Coie, has advised Menendez for more than a decade as his campaign lawyer, a service he has long provided almost every Senate Democrat. He has also advised Majority PAC, the Democratic super PAC that was the recipient of a $700,000 check from Melgen that was earmarked toward Menendez's 2012 reelection and that prosecutors allege was part of the corrupt bargain.

Barrett and Kane reported from Washington.