OPELIKA, Ala. — The excitement began outside the courtroom here on Wednesday morning when Gov. Robert Bentley arrived to testify at the trial of the speaker of the state House of Representatives.

“He walked in through the front door,” one deputy sheriff said to the surprise of another, not long after a man waiting for a different Circuit Court case strained for a glimpse of the governor from a second-floor window.

But to the prosecutors in the public corruption trial of Michael G. Hubbard, Mr. Bentley was just another witness to help make their case that the speaker sought to leverage his office for his personal interests. A prosecutor’s file folder about the witness, who testified for about 20 minutes while his security detail of state troopers stood nearby, carried a simple label: “BENTLEY, ROBERT.”

In the end, Mr. Bentley’s brief turn on the witness stand appeared to offer modest victories for the prosecution and the defense. During the governor’s testimony, lawyers asked him to recount meetings with Mr. Hubbard that focused on certain economic development projects, initiatives that were supported by a company that had hired the speaker as a consultant.