Image copyright From the estate of Anna-Teresa Tymieniecka Image caption Cardinal Karol with Anna-Teresa Tymieniecka on a skiing trip

Pope John Paul II was one of the most influential figures of the 20th Century, revered by millions and made a saint in record time, just nine years after he died. The BBC has seen letters he wrote to a married woman, the Polish-born philosopher Anna-Teresa Tymieniecka, that shed new light on his emotional life.

Anna-Teresa Tymieniecka was a great hoarder, and she seems to have kept everything relating to her 32-year friendship with Saint John Paul. After her death, a huge cache of photographs was found among her possessions. We are used to seeing John Paul in formal papal clothing amid the grandeur of the Vatican, and yet here he is on the ski slopes, wearing shorts on a lake-side camping trip, and, in old age, entertaining privately in his rather sparse-looking living quarters.

Even more revealing is the archive of letters that Anna-Teresa Tymieniecka sold to the National Library of Poland in 2008. These were kept away from public view until they were shown to the BBC.

When the two met in 1973, Cardinal Karol Wojtyla - as he then was - was the Archbishop of Krakow. Anna-Teresa Tymieniecka was Polish by birth, and, like him, had endured the searing experience of the Nazi occupation during World War Two. After the war she left to study abroad and eventually pursued an academic career as a philosopher in the United States, where she married and had three children.

Image copyright From the estate of Anna-Teresa Tymieniecka Image caption Anna-Teresa Tymieniecka with her husband Hendrik Houthakker

It is public knowledge that for four years Cardinal Wojtyla and Anna-Teresa Tymieniecka collaborated on an English-language version of a book on philosophy he wrote while teaching at Lublin University, and Anna-Teresa Tymieniecka has a walk-on part in several John Paul biographies. But the relationship was much deeper and more complex, and continued for far longer than has previously been recognised.

In 2008, the letters were bought by the National Library of Poland for what is thought to be a seven-figure sum. Usually when a library buys an important archive about a figure of Pope John Paul's stature you would expect a bit of a fanfare, and the letters would be put on display and made available to scholars. But these were kept away from public view.

Find out more

Watch Ed Stourton's Panorama report: The Secret Letters of Pope John Paul II on BBC One on Monday 15 February at 20:30. You can catch up via the iPlayer.

In 1970s Poland any relationship between a clergyman and a woman was risky. The communist regime in Warsaw regarded the Catholic Church as the enemy, and the secret police - the SB, as they were known - watched its leaders constantly. Dr Marek Lasota, who has been studying communist-era files at the Institute of National Remembrance in Krakow, says the SB took a particularly close interest in Cardinal Wojtyla. "They installed wiretaps in his flat and his telephone was bugged," he says. "Every letter was intercepted and checked, both private and official."

Image copyright Alamy Image caption Cardinal Wojtyla in the 1970s

So the first hint of any real intimacy comes in a letter sent not from Krakow, but from Rome, where Cardinal Wojtyla spent more than a month attending a meeting of Catholic bishops in the autumn of 1974. He took several of her letters with him so that he could answer them "without using the mail", and writes that they are "so meaningful and deeply personal, even if they are written in philosophical 'code'".

Towards the end of the letter he adds that "there are issues which are too difficult for me to write about".

I have only seen one side of the correspondence - his letters to her - and it is, of course, sometimes impossible to know what the cardinal is referring to. But I have done some old-fashioned journalistic sleuthing, and I believe that at an early stage of the relationship - probably in the summer of 1975 - Anna-Teresa Tymieniecka told Karol Wojtyla that she was in love with him.

Image copyright From the estate of Anna-Teresa Tymieniecka Image caption Cardinal Wojtyla and Anna-Teresa Tymieniecka on a camping trip in 1978

Image copyright From the estate of Anna-Teresa Tymieniecka Image caption Anna-Teresa Tymieniecka and Cardinal Wojtyla in 1977

As Pope, John Paul rewrote the rules of the papacy, travelling the world as no pope had done before him and, in the early days especially, pulling the crowds like a rock star. His response to Anna-Teresa Tymieniecka's declaration when he was a cardinal showed he could be every bit as unconventional in his private life. Far from ending the relationship, as a more prudent prelate might have done, he gave her one of his most treasured possessions - an item of devotional clothing known as a scapular.

Devotional scapulars are formed of two tiny bits of cloth, worn next to the skin over the chest and back, designed to echo the full-length, apron-like garments which monks wear over their habits. Not many Catholics wear them now, but for centuries they were widely used as a symbol of commitment to the Christian life. This one had been given to Karol Wojtyla by his father at the time of his first Holy Communion, and it seems that he invested it with a special significance in his relationship with Anna-Teresa Tymieniecka.

Image caption The scapular given to Ms Tymieniecka

He later told her that it allowed him to "accept and feel you everywhere in all kinds of situations, whether you are close, or far away".

Cardinal Wojtyla had a number of female friends, including Wanda Poltawska, a psychiatrist with whom he also corresponded for decades.

But his letters to Anna-Teresa Tymieniecka are at times more intensely emotional, sometimes wrestling with the meaning of their relationship.

In the summer of 1976 Cardinal Wojtyla was chosen to lead a delegation of Polish bishops to a big Catholic gathering in the United States, and Anna-Teresa Tymieniecka invited him to stay with her family at their country home outside the tiny town of Pomfret in Vermont. It was just the sort of outdoor life he enjoyed, and photographs that I think were taken at the time show him at his most relaxed.

It also seems that she made a further declaration of her feelings for him while he was there, because the letter he wrote to her afterwards suggests he was struggling to make sense of the relationship in Christian terms. He tells her she is a gift from God, and goes on: "If I did not have this conviction, some moral certainty of Grace, and of acting in obedience to it, I would not dare act like this."

Image copyright From the estate of Anna-Teresa Tymieniecka Image caption Cardinal Wojtyla loved spending time outdoors

When he was elected Pope, John Paul wrote to Anna-Teresa Tymieniecka to say that he wanted their connection to continue. He said he did not want "the exchange of ideas, which I have always thought to be so creative and fruitful" to be interrupted. But they fell out badly over the book they had been working on together. She rushed it into print, but the Vatican mounted a legal challenge against it, and she was accused of having distorted the new Pope's ideas. When John Paul failed to stick up for her, she felt betrayed.

But eventually the old warmth returned to the relationship, and some of the most touching photographs and letters we have been able to see relate to his old age.

John Paul was diagnosed with Parkinson's disease in the early 1990s, and became increasingly isolated in the Vatican. She visited him often, and sent him pressed flowers and photographs from her home at Pomfret. In one letter he told her: "I am thinking about you, and in my thoughts I come to Pomfret every day." And his letters include frequent references to their shared past. After his last visit to Poland in 2002 he wrote: "Our mutual homeland; so many places where we met, where we had conversations which were so important to us, where we experienced the beauty of God's presence."

Anna-Teresa's husband, Hendrik Houthakker, was a distinguished Harvard economist. After the collapse of communism, he advised John Paul on post-communist economies, and the Pope granted him a papal knighthood in recognition of his services.

Image copyright From the estate of Anna-Teresa Tymieniecka Image caption Ms Tymieniecka and Pope John Paul II in the Vatican

Anna-Teresa Tymieniecka visited John Paul the day before he died in 2005. He was declared a saint in 2014, and nothing I have found would have been an obstacle to his canonisation. But the process was done and dusted in record time - just nine years. I have been unable to confirm that his correspondence with Anna-Teresa Tymieniecka was considered during the saint-making process, as it certainly should have been.

Carl Bernstein, the veteran investigative journalist of Watergate fame, was the first writer to get some sense of Anna-Teresa Tymieniecka's importance in John Paul's life. He interviewed her for the book His Holiness in the 1990s.

"We are talking about Saint John Paul. This is an extraordinary relationship," he says. "It's not illicit, nonetheless it's fascinating. It changes our perception of him."

Subscribe to the BBC News Magazine's email newsletter to get articles sent to your inbox.