Image copyright PA Media

Thousands of people have camped out overnight as part of a global effort to raise cash to tackle homelessness.

Celebrities were among the hundreds taking part in the World's Big Sleep Out in London, Edinburgh and Cardiff.

Organisers were expecting more than 50,000 to take part globally, with other events in cities including New York, Brisbane and Dublin.

The initiative hopes to raise around £38m ($50m) for homelessness charities.

In London's Trafalgar Square, those camping out faced temperatures of about 10C and heavy rain - conditions which supporters said rough sleepers face every day.

Dame Louise Casey, a former head of the government rough sleepers' unit and trustee of the Big Sleep Out, told the BBC she hoped the event would be "symbolic".

Image caption London's Big Sleep Out was hit by heavy rain on Sunday morning

Image copyright PA Media Image caption The Edinburgh Sleep Out took place in Princes Street Gardens

"It seems absolutely bloody crackers right now - the rain is so heavy - but we're doing it because basically the world has a homelessness problem, it has a displaced people problem, it has refugees," Dame Louise said.

"All of these people are here tonight walking in the shoes of people who are homeless, or people who are refugees, we're just experiencing something for one minute, we're experiencing something that people have to experience all year round.

"It is a privilege to be here this evening - wet and cold as it is."

Image copyright PA Media Image caption Helen Mirren read a bedtime story to the participants in Trafalgar Square

Image copyright PA Media Image caption Supporters hope to raise millions for homelessness charities

The actress Dame Helen Mirren read bedtime stories to those camping in the square while the band Travis played a set.

Among those sleeping out in the capital were the ITV News presenter Julie Etchingham, who hosted the first head-to-head TV debate of the general election.

Image copyright AFP Image caption Film star Will Smith speaks at the Big Sleep Out event in New York

Meanwhile in Edinburgh, veteran actor Brian Cox spoke to crowds in West Princes Street Gardens and in New York, film star Will Smith delivered a speech.

In Cardiff, hundreds slept rough in the city's castle with Gavin and Stacey star Ruth Jones joining those taking part.

The World's Big Sleep Out campaign was created by Josh Littlejohn, the co-founder of the Scottish charity and sandwich shop Social Bite.

The charity has hosted visits from a number of celebrities, including George Clooney and Leonardo DiCaprio.

Mr Littlejohn said he wants "to send a message to the world's political leaders to enact compassionate policy and find solutions for homelessness locally and the global refugee crisis that affects us all".

The Office for National Statistics has said estimates for the number of people rough sleeping suggest numbers are increasing in England, Wales and Northern Ireland, but estimates based on homelessness applications suggest numbers are decreasing in Scotland.