(CNN) – Fresh memories of a mass shooting in a gay nightclub loomed large over LGBT pride celebrations nationwide Sunday, two weeks to the day after a gunman killed 49 people in Florida.

Millions gathered in major American cities for annual celebrations of lesbian, gay, bisexual and transgender communities.

This time last year, parade-goers celebrated a major milestone with the nationwide legalization of same-sex marriage.

This year, heightened security measures and tributes to the 49 victims of the Pulse nightclub shooting in Orlando marked celebrations.

Despite the somber undercurrent, the spirit of jubilation prevailed throughout pride events, embodied by the multi-generational crowds awash in rainbows.

Even if the tone of events was muted, supporters said they took on a special meaning.

"I think it is an act of defiance on one level, to come out and say, 'We stand by our values: inclusion and love and tolerance,' " New York City Mayor Bill de Blasio told CNN on Sunday.

"There's a somber feeling obviously, and there's pain over what happened in Orlando, but the answer is not to run and hide. The answer is to stand up boldly, and that's what New York City is doing today."

With the shooting in mind, law enforcement agencies across the country took additional steps to ensure security.

More than 20,000 people were expected to participate in New York's pride celebration, including Hillary Clinton. The NYPD expected the crowd of parade-goers to exceed last year's estimated size of 1.6 million, New York Police Chief of Patrol Carlos Gomez said.

Total police presence was increased by about 25% over 2015, NYPD Chief of Department James O'Neill said without providing specific numbers.

The increased police presence was evident along the parade route from midtown Manhattan to Greenwich Village past Stonewall Inn, which President Obama recently named as the first national monument to LGBT rights. Thousand of uniformed and plain-clothed officers stood watch along the parade route and from rooftops, Gomez said.

Helicopters were deployed along with bomb-sniffing canines as a network of cameras monitored events in adjoining areas, Gomez said.

Additional community emergency response teams carrying heavy weapons and counterterrorism personnel equipped with radiation detection devices were posted along the route, he said.

"We have greatly increased counterterrorism efforts to act as a visible deterrence as well as a quick response capability," Gomez said.

Extra officers and private security guards watched over festivities in Chicago, where police took the rare step of keeping reporters and photographers from crossing parade barricades, according to CNN affiliate WBBM.

In San Francisco, for the first time, this year's Pride Fest included a security checkpoint screening at every entrance, according to CNN affiliate KGO.

"Our hearts are with Orlando. We think of them every day," San Francisco resident Cory Vaughn told the affiliate. "We have metal detectors, we're all being safe, but we're still looking over our shoulders."

Amid the tributes and enhanced security, a mix of jubilation and reverence permeated celebrations worldwide.

Revelers in London and Milan, Italy took to the streets Saturday in brightly colored outfits to celebrate and pay tribute to the Orlando victims.

"The parade is festive and multicultural like never in the past years," London parade attendee Carlo Feudo told CNN. "This time we do need to be standing all together against hate and discrimination."

Events in New York and Chicago kicked off with moments of silence for victims of the Orlando shootings, a reminder that despite progress for LGBT rights "there is hate in the world," Chicago Mayor Rahm Emanuel said.

The City of Orlando marched in New York's parade carrying 49 flags to commemorate the victims of the attack. Another group of 49 people marched in white in their honor.

An NYPD car bore the message "Our heart goes out to Orlando."

U.S. Rep Tammy Duckworth, who lost her legs in the Iraq war and uses a chair for mobility, rolled through the streets of Chicago with pride.

The annual tradition of marriage proposals continued in two countries.

In London, at least two couples got engaged. One was a pair of Metropolitan Police officers marching in the parade; another was an officer who broke ranks to propose to a crowd member.

In New York, two members of the FDNY got engaged to cheers from onlookers.

Barbara Poma, owner of the Pulse nightclub in Orlando, attended New York's event. She hoped the parade would allow members of the LGBT community to comfort each other through love and support.

"Orlando and the world's gay community are strong and united. We will not allow evil to prevail," she said.