The following correction was printed in the Guardian's Corrections and clarifications column, Saturday 26 September 2009

Great throwaway scoops of our time: "Brown … formally extended his invitation in February, when he met the pope with his wife, Sarah, and his children".

The pope is to visit Britain next year, the first papal visit to the UK in 30 years, after accepting an invitation from Gordon Brown. An announcement is due to be made by Buckingham Palace and the Vatican in the next few days.

Brown, a member of the Church of Scotland, has made three visits to the Vatican, and formally extended his invitation in February, when he met the pope with his wife, Sarah, and his children.

With 4 million Catholics in Britain, the news that the pope has agreed to visit will be seen as a much-needed political boost for Brown. But he may not be prime minister during the visit because it is likely to be next autumn, by which time David Cameron, if the polls are correct, will be installed in office.

Cameron has described his own Christianity as shaky, comparing his beliefs to the reception of Radio Chilterns: coming in and out from time to time.

But last night the Tory leader said: "Such a visit – the first in over a quarter of a century – would be greatly welcomed not only by Roman Catholics but by the country as a whole."

A spokesman for the prime minister said: "It would be a moving and momentous occasion for the whole country and he would undoubtedly receive the warmest of welcomes."

Pope Benedict is expected to visit several parts of Britain, but interest will focus on whether he decides to travel to Northern Ireland, where his presence could stir sectarian trouble. Parts of the Protestant community in Northern Ireland would regard a visit by the pope as a provocative act.

The last pope to visit Britain was Benedict's predecessor, John Paul II, in May 1982, who visited England, Wales and Scotland during a six-day tour.

Last night the Archbishop of Canterbury, Dr Rowan Williams, who was visiting the Anglican Church in Japan, said he was delighted that the pontiff would be visiting Britain. "I'm sure I speak on behalf of Anglicans throughout Britain, in assuring him that he would be received with great warmth and joy."

But a spokesman for the National Secular Society said it would organise "a coalition of groups to make clear to the pope that whatever celebrations the government lays on for him, he is not welcomed here by everyone".

The pope is expected to mark the beatification of John Henry Newman, the most celebrated Anglican convert to Catholicism.

In June he announced the beatification of Newman, following recognition by the Vatican of the healing of an American man with a severe spinal condition as a miracle that was a result of praying to him.

As chancellor, Brown forged personal relations with the pope when he worked with him on his efforts to confront poverty in the developing world.

But the visit could raise issues about Labour's relations with the church, which have sometimes hit trouble owing to controversies such as the Human Fertilisation and Embryology Act, which allowed the use of hybrid embryos for use in medical research.