Justine Greening, the secretary of state for international development, chose Pride to announce that she was in a same-sex relationship, as up to a million people brought much of London to a standstill for the nation’s biggest annual celebration of the LGBT community.

“Today’s a good day to say I’m in a happy same-sex relationship, I campaigned for Stronger In but sometimes you’re better off out! #Pride2016,” Greening, 47, said on her official Twitter account @JustineGreening.

She is the first openly gay woman, and second openly gay Conservative, to hold cabinet office after Scottish secretary David Mundell came out in January.

He was among many people from across the political divide to congratulate Greening, as Pride celebrations helped lift the gloomy mood hanging over largely pro-Europe London since Britain voted to leave the EU.

“Don’t share your politics, but delighted for you, a bit more happiness very welcome at the moment,” said @NigelSarbutts. “What a lovely tweet Justine. Not in same party but I am standing and applauding you,” said @MissLauraMarcus.

The march from Portland Place to Whitehall came to a silent standstill for one minute to mark the crowd’s respect for the 49 deaths in Orlando, Florida, when a gunman attacked the patrons of a gay night club this month.

The atmosphere of Saturday’s event, now in its 43rd year and protected by a visibly increased police presence and police helicopter, was especially highly charged. Participants were keen to show solidarity with the Orlando victims and their bereaved families.

London’s mayor Sadiq Khan addressed the crowds in Trafalgar Square to underline the city’s commitment to the LGBT community and sympathise with the residents of Orlando. In 1999, gay and immigrant communities in Brixton, the East End and the Admiral Duncan pub in Soho were targeted by lone nail bomber, David Copeland.

Speaking before the march, gay rights campaigner Peter Tatchell, who helped set up Pride in 1972, urged marchers and Londoners to unite against hate. “In the wake of the horrific mass murder of LGBT people by an Islamist gunman in Orlando, we are highlighting the need for dialogue, unity and solidarity between the Muslim and LGBT communities – to oppose all hate,” he said.

The Pride marchers were drawn from more than 300 groups, including charities, trades unions, drama, music and sports clubs, political parties and commercial companies.

Competing for attention in what is traditionally the most colourful and flamboyant of annual parades to pass through the city centre were members of the Women’s Equality Party, the Women’s Institute, the London Otters Rowing Club, The Pink Singers, The Gay Men’s Dance Company, National Student Pride, the Chancery Bar Association, Stonewall and The Gay Bikers Motorcycle Club. Perhaps the most high-profile marchers, walking in front of representatives from the cancer charity Marie Curie, were Jennifer Saunders and Joanna Lumley, dressed as their Absolutely Fabulous characters, Edina and Patsy. The film version is released on Friday. Singer Alesha Dixon also entertained revellers.

As well as the extra 100 Met officers in attendance, more than 200 military personnel took part.

A rainbow flag flew from the Houses of Parliament and for the first time there was a flypast by the Red Arrows, both underlining national support. Met police commissioner Sir Bernard Hogan-Howe said there had been “no intelligence” to suggest the march or the city would be targeted, urging people to join in but “take reasonable precaution”.

In Newcastle, Northern Pride will run from Friday, 15 July to Sunday, 17 July and Brighton Pride from Friday 5 August to Sunday, 7 August. Pride events in York, Coventry and Portsmouth took place last weekend.