An important influence on Wilde during his three years (1871-74) at Trinity College, Dublin, the Rev. Mahaffy, Professor of Ancient History and later Provost, was Wilde's tutor from the beginning. During his first two years, Wilde excelled in classics more impressively than Mahaffy had done during his student years there by winning two of the highest honours available: a Foundation Scholarship and the Berkeley gold medal for his achievement in Greek. Mahaffy is said to have urged Wilde, with obvious facetiousness, to leave Trinity College: "Go to Oxford, my dear Oscar: we are all much too clever for you over here". Wilde departed with Mahaffy's good will: in the preface to the first edition of Mahaffy's Social Life in Greece (1874), which contained a frank discussion of Greek homosexuality, the author thanked "Mr. Oscar Wilde of Magdalen College, Oxford" for "having made improvements and corrections all through the book."

In June 1875, when Wilde was in Florence by himself, he met Mahaffy, who had embarked on "a grand tour of the classical world" with a Cambridge undergraduate whose father had engaged Mahaffy to act as guide. Mahaffy invited Wilde to join them in visiting some northern Italian cities. First, they visited Venice: whereas Wilde thought that San Marco was a "most gorgeous" church, Mahaffy "later compared it disparagingly with the Parthenon and instanced Saint Mark's portal as an example of 'the tawdriness which affects the decadence of a great style"'. Leaving the party after a visit to Milan, Wilde, short of funds, returned to England, while Mahaffy and his companion embarked from Naples for Athens.

In August 1876, Mahaffy invited Wilde to assist him in the reading of proofs of his Rambles and Studies in Greece (1876) at his seaside house in Dublin on the Hill of Howth. In a letter to an Oxford friend early in August, Wilde wrote: "I am with that dear Mahaffy every day". In the spring of 1877, Wilde accompanied Mahaffy on "a fateful journey to Greece", "fateful" because Wilde's increasing interest in Roman Catholicism would be undermined by Mahaffy's enthusiasm for Greek culture. Including George Macmillan (1855-1936), of the publishing firm and later a founder of the Hellenic Society, the party was destined for Genoa, where Wilde was planning to leave Mahaffy and Macmillan for Rome.

In a letter to his father, Macmillan wrote on 28 March that Wilde, "being very impressionable," was en route to Rome "in order to see all the glories of the religion which seems to him the highest and the most sentimental. Mahaffy is quite determined to prevent this if possible, and is using every argument he can to check him". Wilde wrote to an Oxford friend on 27 April: "I never went to Rome at all! What a changeable fellow you must think me, but Mahaffy my old tutor carried me off to Greece with him to see Mykenae and Athens".

As a result, Wilde wrote to his tutor at Magdalen College to explain why he would not be back at the beginning of term: "...seeing Greece is really a great education for anyone and will I think benefit me greatly, and Mr. Mahaffy is such a clever man that it is quite as good as going to lectures to be in his society". On the same day that Wilde wrote this letter, Mahaffy wrote to his wife:

We have taken Oscar Wilde with us, who has of course come round under the influence of the moment from Popery to Paganism, but what his Jesuit friends will say, who supplied the money to land him at Rome, it is not hard to guess. I think it is a fair case of cheating the Devil.

When Wilde returned to Oxford, he was "rusticated" - that is, "sent down" for the rest of the term "for being the first undergraduate to visit Olympia," he said many years later. Wilde wrote to an Oxford friend that Mahaffy was "raging! I never saw him so indignantly angry: he looks on it almost as an insult to himself".

Though it has been said that Wilde derived his conversational brilliance from Mahaffy and though Wilde himself told Frank Harris that his old tutor was "a really great talker in a certain way" - the qualification, however, is significant - Stanford and McDowell have concluded: "No very clear influence has been adduced" to warrant the conclusion that Mahaffy significantly shaped Wilde's epigrammatic skill. Mahaffy's influence on Wilde in the direction of Hellenic devotion inevitably resulted - as one might expect - in the student's judgement of his former teacher.

In 1887, Wilde published an anonymous review in the Pall Mall Gazette of Mahaffy's Greek Life and Thought, in which such phrases as "somewhat pedantic," "rather awkward," and "inaccurate" occur in addition to "a certain cheap popular value," though Wilde also calls certain sections "very pleasant indeed," even "excellent." Still, the critical daggers reveal Wilde's need to judge his former tutor from a new position. In December, he also reviewed Mahaffy's The Principles of the Art of Conversation, in which, write Stanford and McDowell, Wilde "adopted a different attitude, not that of one scholar castigating another, but more like that of someone trying to be kind to a less gifted friend .... its tone of condescension may have stung his old tutor more painfully than the outright attack on his classical book".

Despite these reviews, Mahaffy attended one of Wilde's plays - probably A Woman of No Importance - and wrote to congratulate him. Wilde replied to his "charming letter, all the more flattering to me as it comes not merely from a man of high and distinguished culture, but from one to whom I owe so much personally, from my first and my best teacher, from the scholar who showed me how to love Greek things. Let me sign myself, in affection and admiration, your old pupil and your old friend...". When Wilde was arrested and Mahaffy heard of the accusations, he asked, "Were they young boys?" After hearing the reply, he never wanted to hear Wilde's name again. He later refused to sign a petition to the Home Secretary for Wilde's early release. However, he reportedly said to a Dublin writer: "Despite his extravagant garb and effeminate way..., I rather liked Wilde... .

References: Gerald Griffin, The Wild Geese (1938); W. B. Stanford and R. B. McDowell, Mahaffy: A Biography of an Anglo-Irishman (1971).