Media playback is unsupported on your device Media caption Pope Benedict was welcomed by the Queen at the Palace of Holyroodhouse

Pope Benedict has said he wants to "extend the hand of friendship" to the whole of the UK during his visit.

He also urged the UK to resist "more aggressive forms of secularism" after being welcomed by the Queen at Holyroodhouse in Edinburgh.

Tens of thousands of people cheered and waved flags as he travelled through the city centre in the Popemobile, although small protests also took place.

The Pope is now heading to Glasgow for an open-air Mass starting at 1730 BST.

'Special contribution'

The trip is the first to the UK by a Pontiff since John Paul II in 1982. It is also the first to be designated a state visit because the Pope has been invited by the Queen rather than the church.

Pope Benedict was greeted on his arrival by the Duke of Edinburgh, Catholic leaders and a 30-strong honour guard from the Royal Regiment of Scotland. Lord Patten also welcomed him on behalf of the government.

Once at Holyroodhouse, the Queen and the Pope exchanged gifts before each made a speech to those gathered outside.

The Queen said the visit was an opportunity to "deepen the relationship" between Catholicism and the Churches of England and Scotland. She also praised the Catholic Church's "special contribution" to helping the poorest and most vulnerable around the world.

The Pope said he wanted to "extend the hand of friendship" to the entire UK, not just the Catholic population.

He added: "Today, the United Kingdom strives to be a modern and multicultural society. In this challenging enterprise, may it always maintain its respect for those traditional values and cultural expressions that more aggressive forms of secularism no longer value or even tolerate."

The Pope also praised Britain's fight against Hitler's "atheist extremism", saying that "Britain and her leaders stood against a Nazi tyranny that wished to eradicate God from society and denied our common humanity to many, especially the Jews, who were thought unfit to live".

The Popemobile then joined the annual St Ninian's Day parade where, despite tight security, police estimated that about 125,000 people turned out.

After the parade, the pontiff travelled to a private lunch - which reportedly included haggis, neeps and tatties - at the residence of the head of the Catholic Church in Scotland, Cardinal Keith O'Brien. Before going inside he met school children who presented him with bouquets of flowers.

Presbyterians, secularists, and other groups in Edinburgh had planned to protest against Vatican policies on birth control, gay rights and abortion, although police did not report any large demonstrations and said there were no arrests.

Small groups from the organisation Protest the Pope, the Grand Orange Lodge of Scotland and the founder of the Free Presbyterian Church, the Reverend Ian Paisley, now Lord Bannside, turned out in protest.

Child abuse

During his flight from Rome, in response to a question from the BBC, the Pope said the scandal surrounding the abuse of children by Catholic priests had come as a great personal shock to him.

He said he wanted to offer the victims "material, psychological and spiritual" help and to protect other children from dangerous priests in the future.

Asked about the protests, the Pope told journalists said the UK had a "great history of anti-Catholicism", but also "a great history of tolerance".

Meanwhile, one of the Pope's senior advisers - Cardinal Walter Kasper - did not make the trip after he told a German magazine that arriving at Heathrow airport was like landing in a "Third World country".

The Vatican said the cardinal had not intended "any kind of slight" and had simply pulled out due to illness. Officials also said his "Third World" comment referred to the UK's multicultural society.

Eyewitness By David Willey, BBC correspondent, with the Pope Even before his arrival the Pope faced questions from journalists aboard the papal plane. The Pope said the revelations about sex abuse by priests had caused him great sadness. How was it possible, the Pope asked himself, that priests who had been trained for years to be good pastors could fall into this state? The Church must show penance and humility. He congratulated the English bishops on the strong measures they have taken to deal with the problem. Was he apprehensive about some opposition expressed in Britain to his state visit? No, he said. During his pastoral visits to France and to the Czech Republic, the Pope said there had been strong anti-clerical feelings expressed. But nonetheless, he had received a warm welcome in France from agnostics and in Italy, too, there was a long history of anti-clericism. On how to create a more credible church, the Pope said the Church did not work for itself but for others in order to make the gospel message more accessible. Anglicans and Catholics have essentially the same task - to work together, he said.

Cardinal O'Brien said he was "sure Cardinal Kasper will apologise for any intemperate remarks which he made".

Slow sales

On Thursday evening, the Pope will celebrate an open-air Mass at Bellahouston Park in Glasgow.

The Catholic Church in Scotland had hoped to attract up to 100,000 to the event, but later reduced the capacity to 65,000 after a slow take-up of tickets.

Dioceses in England and Wales have also reported thousands of unfilled places for a vigil in London's Hyde Park on Saturday and a beatification Mass in Birmingham on Sunday for 19th century cardinal John Henry Newman.

The Pope flies to London on Thursday night and will spend the next two days meeting religious and political leaders, Catholic groups and holding prayers and Mass.

The total cost of the Pope's stay to the taxpayer will be between £10m and £12m, with the bill for policing estimated at an additional £1.5m.