They got off to a bad start. Michael O'Leary bounded up into the witness box and took the bible in his right hand. His left remained rooted in a pocket. "Will you take your hand out of your pocket while the oath is being administered, please," Judge Peter Kelly asked. O'Leary complied, but it was obvious from the off that these two boys would never be sharing a few pints together.

O'Leary was appearing in the High Court on Friday afternoon on foot of a request from the judge. On Wednesday, Kelly had been notified that an important letter sent by transport minister Noel Dempsey to O'Leary was not included in affidavits sworn by two solicitors on behalf of Ryanair. The airline, a frequent flyer to the courts, is involved in litigation over O'Leary's perennial bugbear – passenger charges at Dublin airport.

Judge Kelly felt he had been misled by the omission of the letter in question. He suggested that O'Leary hightail it down to the courts by 2pm on Friday. Cometh the hour, there was the man, dolled up to the nines by his standards, in flannel trousers and smart jacket.

The attraction of a court appearance by O'Leary is obvious. When lawyers or a judge are performing their functions properly, facts are parsed and analysed in a cold, clinical manner in court. Spin is squeezed out. Spin is O'Leary's forte. He is by any standards a master communicator.

Just last month, he performed Herculean feats by spinning the construction of a Ryanair hangar in Scotland into a scenario whereby Mary Coughlan, Aer Lingus and the Dublin Airport Authority were ineptly allowing jobs to flee the country. Different class, as our footballing brethren might say.

Peter Kelly is no slouch at his own business. He presides over the Commercial Court. For the last 18 months, he has been sifting through the embers of the Celtic bonfire. All manner of wideboys, shysters, fools, not to mention lawyers and accountants displaying the ethics of vultures, have been parading through his court. Through his public comments and his work in general he has delivered a devastating critique of what transpired during the madness. He is a rare species at the current time, somebody who draws his authority from the performance of his duty rather than the status of the office he occupies.

O'Leary told the court he was there on foot of the court report in the Irish Times the previous day (Thursday). The judge's suggestion on Wednesday that he was misleading the court obviously didn't prompt any underling to contact him that evening. He just read about it in the papers.

"I'd like to add my own apology," he said, referring to the words of sorrow expressed by the two solicitors who swore the offending affidavits.

"How is it that both of them were unaware of the letter," the judge wanted to know.

"I did not give them the letter. They didn't check the file," O'Leary said. He launched into one of his standard soliloquies about the crazy bureaucracy Ryanair has to endure from the assorted arms of the state. He said that if he had seen the affidavit he would have amended it in relation to a sentence which implied there had been no communication on the relevant matter with Dempsey, but he wouldn't have included the letter anyway because it wasn't relevant.

Four times the judge asked him whether he would have included the letter.

"Was I going to be told in affidavit form what the minister had decided," Kelly asked, with growing exasperation. O'Leary's lawyer got up and tried to explain where his client was coming from.

"You're fencing with me now," the judge said. "He's the chief executive of Ryanair. He calls the shots."

At one stage, the judge told O'Leary, "You're contradicting yourself."

"I'm not contradicting myself," the spinmeister replied.

O'Leary and his company have form with the judiciary. In 2005, Judge Barry White threatened to jail the Ryanair chief if he didn't comply with a court order to reinstate a pilot to a roster. O'Leary drew back at the last moment.

In 2006, judge Thomas Smyth said that for only the second time in his career, he felt compelled to rule that witnesses had given false evidence under oath, referring to two Ryanair executives.

Despite the rarity of the ruling, no charges of perjury were ever forthcoming from the DPP. Neither were the executives sanctioned by Ryanair. The ruling didn't affect the bottom line, and beyond that, who, as Mickser himself might put it, gives a fiddlers?

On Friday, the fireworks exploded when a lawyer for the Dublin Airport Authority produced a separate letter which O'Leary had written to Dempsey beseeching the minister to organise for a review of the airport charges.

"Both judge Kelly and the DAA lawyers were critical of your delay in appointing an appeals panel," O'Leary wrote. Kelly hit the roof. He had made no criticism of Dempsey.

"You are representing to the minister something you say I said. Where did I say that," he wanted to know. O'Leary made what the judge later referred to as a "pathetic" attempt to justify the comment. By then, the spinmeister was transmogrifying into the squirmmeister.

O'Leary said the offending passage was a misquote.

"It is not a misquote, it is a lie," the judge said.

The DAA lawyer Cian Ferriter produced a press release Ryanair had issued calling the minister "dozy Dempsey" and "doolittle Dempsey". This was two days after Dempsey had written a letter to O'Leary undertaking to set up the review panel.

Ferriter put it to the witness. "There is a pattern of mislead. You misled the court, the Commission for Aviation Regulation, the minister, the public and [Ryanair's] solicitors… it shows a disregard for the truth". O'Leary rejected the multiple misleadings.

Judge Kelly was more interested in how he had been misrepresented. O'Leary said he would apologise. "It's not just enough that he apologises to the court," the judge replied.

O'Leary's lawyer took the hint. "Do you wish to apologise to the minister?"

"Yes I do."

The judge was taking no chances. "Hadn't he better write to the minister and tell him that I didn't criticise him… I want to see the letter before it is sent."

At the end of the proceedings, Judge Kelly told O'Leary he was lucky the matter wasn't being treated as contempt. He put back the substantive issue, allowing the DAA and others time to apply to strike out the action on the basis of Ryanair's conduct. He wants to see O'Leary's letter of apology to Dempsey by Tuesday.

Outside, Mickser was visibly shaken. He said he would write the letter of apology that evening. After a few questions, the reporters drifted off. "Is that it," he asked, looking like a man who badly needed a microphone to crank up his self-confidence and restart the spinning machine.

He will be back in court on Tuesday with his draft letter for Dempsey. It might be fitting if he turns up in short trousers and school tie and cap. And he would be well advised to have everything in order. Any excuses about the horse eating his homework won't wash with Peter Kelly.

Meanwhile, if you happen to see Noel Dempsey this weekend, he will most likely have a smile on his face as wide as the Shannon, a spring in his step befitting a mountain goat. The smart money says he will get the letter framed and hang it in a choice position in his loo.