"I am now an honorary Doctor of Letters at Cambridge University UK," wrote the actor on his official Facebook page. He also posted two pictures of him at the institution. "My old college St Catharine's celebrated by flying the rainbow flag."
The event coincides with LGBT Pride events in many cities.
McKellen's Broadway credits include the repertory production of Waiting for Godot and No Man's Land, in which he co-starred with Sir Patrick Stewart, The Promise, Amadeus, Ian McKellen: Acting Shakespeare, Wild Honey, Ian McKellen: A Knight Out at the Lyceum and Dance of Death.
The two-time Oscar nominee's film work includes "The Lord of the Rings," "The Hobbit" and "X-Men."