It was a brief, surprising, handshake between two men at opposite sides of the biggest Wall Street insider trading trial in decades.

Goldman Sachs Chief Executive Lloyd Blankfein extended his hand to accused hedge fund founder Raj Rajaratnam, after testifying for more than an hour on Wednesday as a government witness in Manhattan federal court.

The 30-second encounter was a show of courtesy by the head of Wall Street's most influential bank to a one-time billionaire whose firm was a Goldman client.

Sri Lankan-born Rajaratnam is fighting for his liberty, with a multimillion dollar defense team arguing that his stock trades were based on research or public information. Prosecutors contend he made $45 million in illegal profit from insider tips, including leaks from a former Goldman director.

Blankfein told jurors that the former board member, Rajat Gupta, breached fiduciary duties to Goldman by leaking board secrets to Rajaratnam.

The Brooklyn, New York-born CEO made his approach to the defense team during a break in the proceedings.

With his hand in his suit pocket, he walked up to defense lawyer John Dowd and other attorneys who were chatting with Rajaratnam. Dowd, a tall, former captain in the U.S. Marines, firmly shook the hand of the diminutive Blankfein and put his arm around him. They exchanged some words and a laugh.

Then, 56-year-old Blankfein rapidly extended his arm and quickly shook Rajaratnam's hand. They exchanged a few inaudible words, Rajaratnam smiled and Blankfein moved away.

CONTRASTS WITH CONGRESSIONAL HEARING

Blankfein's starring role at the trial was his first major public appearance since a tense congressional hearing last April, when he was blasted by lawmakers over Goldman's ethics and behavior toward clients.

But unlike last time, the government was on Blankfein's side, using him as a key witness in its insider trading case against Rajaratnam, 53.

The CEO also appeared more calm and relaxed this time, laughing along with everyone else in the crowded courtroom when there was trouble with the sound system and when he told of his surprise about Goldman's first ever quarterly loss in the financial crisis. We were generally making money.

Asked by prosecutor Andrew Michaelson whether Gupta violated his duties as a board member to put the interests of the company first, Blankfein said matter of factly: My sense of it, yes.

Earlier, Michaelson showed Blankfein a photograph of Gupta.

Do you recognize this individual? the prosecutor asked. Yes, Blankfein said, as Michaelson pinned the picture on a board in front of the 12-member jury. It's Rajat Gupta.

Even under cross-examination, Blankfein remained calm. Apart from one or two moments of hesitation and a grammatical error or two, he was unflustered.

Dowd asked him whether he knew of allegations against Gupta in March 2010 when Goldman announced the director was not running for reelection.

I had awareness of -- I want to say inkling, Blankfein said. I know a lot more after than I knew at that time, but I knew that there was questions about Rajat's behavior. That's how I would say it.

Blankfein strode confidently to the witness stand at 10.20 a.m. and in three hours of testimony, he spoke with the air of a man who is accustomed to being in charge.

He provided tidbits about the way Goldman is run, his management style and interaction with clients.

For instance, he told the court that he receives daily voicemail and email messages about Goldman's profits-and-loss statement, which he sometimes puts off reviewing if the trading day seems ordinary.

The board meets at least five times a year, Blankfein said, and can call impromptu meetings for special circumstances, as it did at times during the financial crisis.

But he said he confers with board members individually in case there's something they want to tell me that they don't want the other board members to hear.

Blankfein, chairman and CEO of Goldman for nearly five years, said he sees his role as outlining broad strategy, then relying on subordinates to execute.

Dowd described Galleon as a Tier 1 client of Goldman's, then asked Blankfein to describe what designates a particular client as part of one Tier or another.

I'm not entirely sure myself, Blankfein said.

The case is USA v Raj Rajaratnam et al, U.S. District Court for the Southern District of New York, No. 09-01184.

(Additional reporting and writing by Grant McCool; Editing by Bernard Orr)