Actor and gay rights activist Sir Ian McKellen has reportedly signed a deal worth £1 million to pen an autobiography.

The Sunday Times reports that the actor has signed a deal with Hachette following “lengthy negotiations” with a number of publishers.

According to the newspaper, the mammoth book deal will cover the life of the actor – who co-founded gay rights group Stonewall – from his childhood through to his roles in X-Men and Lord of the Rings.

The as-yet-unwritten memoir will also go into detail on his decision to come out as gay in 1988 – at a time when gay actors were still largely shunned for work.

The 76-year-old actor has previously insisted he is “too busy” to write a memoir, but has recently suggested he would be taking on less acting work.

McKellen’s book deal was arranged by Paul Stevens of Independent Talent, according to the newspaper, with the process of finding a publisher beginning late last year.

His latest film Mr Holmes opened this week – with the star sharing a kiss with close friend and X-Men colleague Patrick Strewart on the red carpet.

It appeared to be the pair’s reply to criticism of Stewart – who took to Facebook to defend himself from claims of homophobia after siding with a Christian bakery that refused to make a ‘support gay marriage’ cake.

Appearing on Newsnight, the actor he was “on the side of the bakers” and “supports their rights to say no”.

Judging by the kiss, the gay rights campaigner did not seem too upset with his friend’s comments.