Wilde believed in his way of life so strongly that he eventually spent several years in jail after his attempts to defend it.
At issue was Wilde's relationship with Lord Alfred ("Douglas"). Wilde was forty years old at the time of the trials; Lord Alfred was sixteen years his junior but no child, at age twenty-four, and certainly not an innocent. They first met in the early summer of 1891. Douglas was a devoted fan of Wilde's novel, The Picture of Dorian Gray, claiming that he had read it either nine or fourteen times. Lord Alfred was a slight, handsome, impetuous young man who already had a very difficult relationship with his father. He had homosexual relations with several boys at Oxford and was blackmailed in the spring of 1892. He was especially irresponsible about money, often insisting that Wilde spend lavish amounts on him.
Lord Alfred's father, the Eighth Marquess of Queensberry (1844–1900), was irate about the relationship between his son and Wilde and sought to discredit Wilde. While Douglas was visiting Algeria, the father hoped to disrupt the opening performance of Wilde's play The Importance of Being Earnest but was turned away. On February 18, 1895, he left a card for Wilde at the Albemarle Club, addressed "To Oscar Wilde posing Somdomite," misspelling the last word. Homosexual activity was illegal in England.
Wilde had several choices. Having been accused, publicly, in writing, he might have cause to bring a libel suit against the Marquess. The card certainly was seen by the hall porter, Sidney Wright, who knew that an insult was intended and carefully noted the details of the card's arrival, although he was not able to deliver it to Wilde for ten days. Wilde wrote to his good friend, Robert Ross, stating that he felt compelled to pursue criminal prosecution of the Marquess. Ross wisely advised Wilde to ignore the card and allow Lord Alfred and his father to settle their differences themselves. Another alternative was for Wilde to visit France for a time and hope that tempers would cool.
Wilde's biggest problem was that the accusation was true. Wilde had several such relationships with young men, including Douglas. A written statement is not libelous if it is true. However, Wilde assured his attorneys that the charge was false. There is some evidence that Wilde tried to back out of the trial at the last moment, saying that he could not afford it, but Lord Alfred was adamant in wanting to prosecute his father and promised financial support from relatives.
Queensberry's trial opened at the Central Criminal Court (Old Bailey) on April 3, 1895. The trial went badly for Wilde. He was asked several questions about The Picture of Dorian Gray and the relationships between older and younger men in that novel, and he was accused of relations with other young men, not just Lord Alfred. Sir Edward Clarke, his attorney, advised Wilde to withdraw, hoping privately (he revealed later) that Wilde could escape the country. Wilde had several hours during which he could have done so. Ross and others encouraged him to flee, but he stayed. A warrant was issued for Wilde's arrest since Queensberry's justification forced the authorities to recognize Wilde's implied guilt. Wilde wrote to the Evening News that he could not win the case without pitting Douglas against his father in court and chose not to do so — a calculated response by Wilde.
The second trial began on April 26. Clarke again represented Wilde, this time without fee. The most dramatic part of the trial involved a poem written by Douglas and titled "Two Loves," which ends with the words, "I am the love that dare not speak its name." When asked what that might mean, Wilde responded with such eloquence that many in the gallery burst into applause, although some hissed. Wilde alluded to Michelangelo and Shakespeare, among others, as older men who had "deep, spiritual affection" for younger men in "the noblest form of affection." He argued that such relationships were much misunderstood in the nineteenth century and the reason for his being on trial. One dare not speak the name of this noble love, he concluded, because it was so misunderstood. The speech probably influenced the jury's inability to agree on a verdict.
The third trial, a second attempt to prosecute Wilde (after the hung jury of the second trial), opened on May 22. Again, friends urged Wilde to flee the country, but he wrote to Lord Alfred that he "did not want to be called a coward or a deserter." The prosecution benefited from the previous trial and won. Wilde was found guilty of indecent behavior with men, a lesser charge but one for which he received the maximum penalty under the Criminal Law Amendment Act: two years at hard labor.
Those familiar with the history of the period might note parallels between the Dreyfus Affair (1894–1906) in France and Oscar Wilde's trials in England. Alfred Dreyfus was the son of a Jewish textile manufacturer; he joined the military and rose to the rank of captain. He was accused of selling military secrets to the Germans and convicted of treason in December 1894. The trial was highly irregular, and the conviction was based on insufficient evidence. Much of the impetus for the trial came from political conservatives, anti-Semitic groups, and publications such as the newspaper La Libre Parole. They encouraged the public to believe that French Jews were disloyal. The novelist Émile Zola led other intellectuals and politicians in a campaign on Dreyfus' behalf. After two more trials and considerate turmoil, Dreyfus eventually was pardoned and the judgment set aside. Dreyfus had been persecuted for religious and political reasons; Oscar Wilde was persecuted for being a homosexual.