The multi-millionaire owner of Harrods had also told the jury that Prime Minister Margaret Thatcher "threw me to the dogs" because she was worried that The Observer, then owned by his business rival Tiny Rowland, knew that her son Mark Thatcher "had got hundreds of millions of commission from arms deals".
The exchange over gays in the Cabinet came after the jury was told that Mr Fayed had described former Tory minister Neil Hamilton as a "homosexual prostitute" in a secret videotape of a private lunch with the Lonrho boss Mr Rowland.
Desmond Browne, QC for Mr Hamilton, the former MP for Tatton, accused Mr Fayed of "nothing but vicious invention". The Egyptian-born businessman responded: "There is rumours. I just mentioned in a casual discussion... I think it is true. I have nothing against homosexuals, I employ hundreds of homosexuals... there are homosexuals, Chris Smith in the Cabinet and the minister of agriculture...."
The judge, Mr Justice Morland, stopped him and said: "Mr Al Fayed, if you go on like this I will stop you giving evidence." Mr Fayed said: "I am sorry. I am just supporting my answer."
Mr Hamilton is suing Mr Fayed over allegations that the former MP asked questions in the House of Commons beneficial to Harrods and received cash, gifts and a free holiday at the Paris Ritz in return.
Watched by former health minister Edwina Currie, due to give evidence for him later, Mr Fayed recalled a conversation he had with the then editor of the Sunday Express, Brian Hitchen, in September 1994. Mr Hitchen said Mr Fayed's revelations about Mr Hamilton were "dynamite" and added that he would take them to the Prime Minister, John Major.
Mr Hitchen asked Mr Fayed what he would settle for, and Mr Fayed replied that he wanted the critical 1988 Trade and Industry report into his purchase of Harrods withdrawn.
Mr Fayed said: "I would like him to explain to the Prime Minister all the injustice, all the attacks on me - how somebody like me who came to this country, brought his money, his investment, created this great business, can be insulted, humiliated in hearsay reports.
"Is this fair? It's not good for the country, it's not good example for foreign investor, coming from the Middle East, take the country as his own, sacrifice his life and everything I done for Margaret Thatcher - all the things she asked of me - save the pound and brokered major arms deals.
"You think that fair, that Margaret Thatcher, when it suit her, she just throw me to the dogs, because she was worried that Tiny Rowland with The Observer, he knew about her son's arms deals? It's published on TV, on radio, in newspapers that Mark Thatcher had got hundreds of millions of commission for arms deals...."
The judge cut in: "That is the first and last speech today." But Mr Fayed carried on, saying that Baroness Thatcher wanted to "cover up" her son's arms deals and was "forced" to put the DTI inspectors on to him.
The case continues.