Prime minister David Cameron hosted a reception for lesbian, gay, bisexual and trans people in 10 Downing Street’s rose garden on Wednesday evening.

He promised the crowd the coalition government would change the law to allow religious buildings to host civil partnership ceremonies, a measure introduced in the last parliament by out gay peer Lord Alli.

The guestlist featured gay politicians, including Nick Herbert, Stephen Williams and Margot James, gay charity heads, campaigners and several celebrities such as Blue’s Duncan James.

Straight politicians including Nick Clegg, Eric Pickles, William Hague and Theresa May were present.

Also attending were representatives of councils and local Prides from across the country, along with gay business leaders such as former BMI owner Sir Michael Bishop.

Mr Cameron gave a short speech in which he said the summer was not “just about football, it is also about Pride”.

As he said last year at a Pride event, he admitted his party had “not always got this issue right”.

He said: ” I don’t need to say that all again, but what I do say is I know we didn’t get this right in the past, I know that we were slow learners, we had a long way to travel, but I am proud of the fact that we have travelled a long way in terms of supporting civil partnerships, in terms of standing up for equal rights and for equal treatment, and I think that is very important.”

After listing several election commitments on gay equality, he announced the coalition government would “make sure” religious organisations are permitted to hold civil partnerships.

He said: “I am pleased to announce today that we are taking a further step, and I think a good step and a right step – and I say this as someone who believes in marriage, who believes in civil partnership, who believes in commitment – and that is to say that if religious organisations, if churches, if mosques, if temples want to have civil partnerships celebrated at religious places of worship, that should be able to happen and we should make that happen.

“Of course those organisations that don’t want that to happen have their rights too, but we shouldn’t let some legalistic nonsense get in the way of people who want to celebrate civil partnerships in churches, and when there are churches that want that to happen, we should allow that to happen.

“I think that will be an important step forward and we are going to make sure that that does happen.”

Mr Cameron added: “The truth is we will never really tackle homophobic bullying in schools and we will never tackle homophobic issues in the workplace just by passing laws; it is culture change and behavioural change that is needed as well.”

He also paid tribute to the Liberal Democrats for their campaigning on gay equality, and to the previous Labour government for advances such as civil partnerships.

The coalition government published a document on Wednesday outlining its commitments to gay equality measures.

It includes specific policies for trans people and the pledge to remove historic convictions for now-legal gay sex offences.